Add unit tests
Some small first unit tests for the common, module, at least.
This commit is contained in:
parent
ba4b781c31
commit
6ea5a42819
16 changed files with 394 additions and 28 deletions
22
scripts/make.sh
Executable file
22
scripts/make.sh
Executable file
|
|
@ -0,0 +1,22 @@
|
|||
#!/bin/sh
|
||||
|
||||
EXTENSION_NAME="mastodon-auto-remote-follow@rugk.github.io"
|
||||
|
||||
mkdir -p "build"
|
||||
|
||||
# license should be in add-on
|
||||
mv LICENSE.md src/LICENSE.md
|
||||
|
||||
# make sure we are using the stable manifest
|
||||
# as the dev edition manifest.json allows mocha.css and mocha.js in the CSP
|
||||
cp "./scripts/manifests/firefox.json" "./src/manifest.json" || exit
|
||||
|
||||
# create zip
|
||||
cd src || exit
|
||||
zip -r -FS "../build/$EXTENSION_NAME.zip" ./* --exclude "tests/*"
|
||||
|
||||
# revert changes
|
||||
mv LICENSE.md ../LICENSE.md
|
||||
cp "../scripts/manifests/dev.json" "../src/manifest.json"
|
||||
|
||||
cd ..
|
||||
44
scripts/manifests/dev.json
Normal file
44
scripts/manifests/dev.json
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
{
|
||||
"manifest_version": 2,
|
||||
"name": "__MSG_extensionName__",
|
||||
"short_name": "__MSG_extensionNameShort__",
|
||||
"version": "0.7",
|
||||
"author": "rugk",
|
||||
|
||||
"description": "__MSG_extensionDescription__",
|
||||
"homepage_url": "https://github.com/rugk/mastodon-simplified-federation",
|
||||
|
||||
// testing version allows loading unit test libraries from CDNs
|
||||
"content_security_policy": "default-src 'self'; connect-src https:; style-src 'self' https://unpkg.com; script-src 'self' https://unpkg.com",
|
||||
"icons": {
|
||||
"16": "icons/icon.svg",
|
||||
"32": "icons/icon.svg",
|
||||
"48": "icons/icon.svg",
|
||||
"96": "icons/icon.svg"
|
||||
},
|
||||
"default_locale": "en",
|
||||
|
||||
"options_ui": {
|
||||
"page": "options/options.html",
|
||||
"browser_style": true
|
||||
},
|
||||
|
||||
"background": {
|
||||
"page": "background/background.html"
|
||||
},
|
||||
|
||||
"permissions": [
|
||||
"storage",
|
||||
"tabs",
|
||||
"webRequest",
|
||||
"http://*/*",
|
||||
"https://*/*"
|
||||
],
|
||||
|
||||
"applications": {
|
||||
"gecko": {
|
||||
"id": "mastodon-auto-remote-follow@rugk.github.io",
|
||||
"strict_min_version": "61.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
43
scripts/manifests/firefox.json
Normal file
43
scripts/manifests/firefox.json
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
{
|
||||
"manifest_version": 2,
|
||||
"name": "__MSG_extensionName__",
|
||||
"short_name": "__MSG_extensionNameShort__",
|
||||
"version": "0.7",
|
||||
"author": "rugk",
|
||||
|
||||
"description": "__MSG_extensionDescription__",
|
||||
"homepage_url": "https://github.com/rugk/mastodon-simplified-federation",
|
||||
|
||||
"content_security_policy": "default-src 'self'; connect-src https:",
|
||||
"icons": {
|
||||
"16": "icons/icon.svg",
|
||||
"32": "icons/icon.svg",
|
||||
"48": "icons/icon.svg",
|
||||
"96": "icons/icon.svg"
|
||||
},
|
||||
"default_locale": "en",
|
||||
|
||||
"options_ui": {
|
||||
"page": "options/options.html",
|
||||
"browser_style": true
|
||||
},
|
||||
|
||||
"background": {
|
||||
"page": "background/background.html"
|
||||
},
|
||||
|
||||
"permissions": [
|
||||
"storage",
|
||||
"tabs",
|
||||
"webRequest",
|
||||
"http://*/*",
|
||||
"https://*/*"
|
||||
],
|
||||
|
||||
"applications": {
|
||||
"gecko": {
|
||||
"id": "mastodon-auto-remote-follow@rugk.github.io",
|
||||
"strict_min_version": "61.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue