Add unit tests

Some small first unit tests for the common, module, at least.
This commit is contained in:
rugk 2018-09-01 13:48:43 +02:00
parent ba4b781c31
commit 6ea5a42819
No known key found for this signature in database
GPG key ID: 05D40A636AFAB34D
16 changed files with 394 additions and 28 deletions

22
scripts/make.sh Executable file
View 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 ..

View 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"
}
}
}

View 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"
}
}
}