setting up tests and config for typescript

This commit is contained in:
tambien 2019-05-23 13:59:08 -04:00
parent bd31558de6
commit 4aca4f81e6
3 changed files with 21 additions and 9 deletions

View file

@ -18,11 +18,11 @@
"collect:deps": "node scripts/collect_deps.js",
"collect:tests": "node scripts/collect_tests.js --file $npm_config_file --dir $npm_config_dir",
"increment": "node scripts/increment_version.js",
"karma": "karma start scripts/karma.conf.js --single-run",
"karma:watch": "karma start scripts/karma.conf.js --auto-watch --browsers Chrome",
"karma": "karma start scripts/karma.conf.js --single-run --grep $npm_config_grep",
"karma:watch": "karma start scripts/karma.conf.js --auto-watch --browsers OnlineChrome --grep $npm_config_grep",
"lint:fix": "eslint Tone/*/*.ts --fix",
"scratch": "webpack -w --env.scratch --mode=development",
"test": "npm run collect:tests && npm run karma",
"test": "npm run karma",
"test:watch": "npm run collect:tests && npm run karma:watch",
"test:browser": "npm run collect:tests && concurrently \"webpack -w --mode=development --env.test\" \"http-server -p 9090 -c-1\" \"open http://localhost:9090/build/test.html\"",
"test:travis": "npm run build && npm run lint && npm run test",
@ -30,8 +30,10 @@
"test:node": "node ./test/html/node_test.js",
"tsd": "node ./scripts/generate_docs.js",
"lint": "tslint --project tslint.json",
"lint:fix": "tslint --project tslint.json --fix",
"tsc:watch": "tsc --watch",
"watch": "npm run increment && npm run collect:deps && webpack -w --env.production --mode=development"
"watch:old": "npm run increment && npm run collect:deps && webpack -w --env.production --mode=development",
"watch": "tsc --watch"
},
"repository": {
"type": "git",

View file

@ -1,5 +1,10 @@
// Karma configuration
const path = require("path");
const argv = require("yargs")
.option("grep", {
default: "",
})
.argv;
let BROWSERS = ["HeadlessChrome", "HeadlessFirefox", "Safari"];
@ -47,7 +52,7 @@ module.exports = function(config) {
},
},
coverageOptions : {
exclude: /test\/.*\.ts$/i,
exclude: /.*\.test\.ts$/i,
},
reports: {
html: path.resolve(__dirname, "../coverage"),
@ -91,9 +96,9 @@ module.exports = function(config) {
client : {
mocha : {
grep: "Gain",
timeout : 30000,
reporter : "html", // change Karma's debug.html to the mocha web reporter
grep: argv.grep,
reporter : "html",
timeout : 10000,
ui : "bdd",
},
},
@ -143,6 +148,11 @@ module.exports = function(config) {
"media.navigator.permission.disabled" : true,
},
},
OnlineChrome: {
base: "Chrome",
flags: ["--no-sandbox", "--use-fake-ui-for-media-stream", "--use-fake-device-for-media-stream",
"--autoplay-policy=no-user-gesture-required"],
},
},
};

View file

@ -11,7 +11,7 @@
// "outFile": "./build/Tone.js",
"outDir": "./build",
"sourceMap": true,
"moduleResolution": "classic",
"moduleResolution": "node",
"strictPropertyInitialization" : true,
"lib": ["es6", "dom"],
"baseUrl": "./",