aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2016-04-27 15:31:15 +0200
committerFlorian Dold <florian.dold@gmail.com>2016-04-27 15:31:15 +0200
commit97f3911c93c841f089f705e7edcef6a6bec45f2e (patch)
tree50b0b425ac3d977ed90aa4bc74e1e7b5e59ff93c
parent004a0372abd42da19690d95b25ede5b0ffe10601 (diff)
downloadwallet-core-97f3911c93c841f089f705e7edcef6a6bec45f2e.tar.xz
istanbul instrumentation
-rw-r--r--package.json5
-rw-r--r--test/run_tests.js15
2 files changed, 17 insertions, 3 deletions
diff --git a/package.json b/package.json
index 7aaeaff26..f86943a13 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,8 @@
"description": "",
"main": "wxwallet.js",
"scripts": {
- "test": "mocha --delay"
+ "test": "mocha --delay",
+ "test-cover": "istanbul cover -x libwrapper.js _mocha -- --delay"
},
"repository": {
"type": "git",
@@ -26,6 +27,7 @@
"gulp-tar": "^1.8.0",
"gulp-typescript": "^2.10.0",
"gulp-zip": "^3.1.0",
+ "istanbul-lib-instrument": "^1.0.0-alpha.6",
"jed": "^1.1.0",
"map-stream": "0.0.6",
"mocha": "^2.4.5",
@@ -33,6 +35,7 @@
"systemjs": "^0.19.14",
"through2": "^2.0.1",
"typescript": "^1.9.0-dev.20160225",
+ "typhonjs-istanbul-instrument-jspm": "^0.1.0",
"vinyl": "^1.1.1"
}
}
diff --git a/test/run_tests.js b/test/run_tests.js
index f6a623942..88aded741 100644
--- a/test/run_tests.js
+++ b/test/run_tests.js
@@ -12,7 +12,7 @@
let assert = require("better-assert");
let vm = require("vm");
let fs = require("fs");
-
+let instrument = require("typhonjs-istanbul-instrument-jspm").default;
if ("function" !== typeof run) {
throw Error("test must be run with 'mocha --delay ...'");
@@ -23,10 +23,21 @@ let emsc = require("../lib/emscripten/libwrapper.js");
// Do it here, since it breaks 'require'' for libwrapper
let System = require("systemjs");
+
System.config({
- defaultJSExtensions: true
+ defaultJSExtensions: true,
+ meta: {
+ './test/tests/taler.js': {
+ format: 'register'
+ },
+ './lib/wallet/*': {
+ format: 'register'
+ }
+ }
});
+instrument(System);
+
let mod = System.newModule({Module: emsc});
let modName = System.normalizeSync(__dirname + "/../lib/emscripten/emsc");
console.log("registering", modName);