diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-05-08 10:27:26 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-05-08 10:27:26 +0200 |
commit | 2c90c1e9037455415f3a56fcfdb1e02283d4ee2c (patch) | |
tree | cdf22461eff3106df555bb4e9ac3ad2f633505c4 /test/run_tests.js | |
parent | 12a12d883aae49a9dcedc8b487121b9926cff0fa (diff) | |
parent | dc83b85e85110eb7ed2e96ecdbcbb90b5a5620aa (diff) | |
download | wallet-core-2c90c1e9037455415f3a56fcfdb1e02283d4ee2c.tar.xz |
Merge branch 'master' of git+ssh://taler.net/var/git/wallet-webex
Diffstat (limited to 'test/run_tests.js')
-rw-r--r-- | test/run_tests.js | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/test/run_tests.js b/test/run_tests.js index f62810f7e..88aded741 100644 --- a/test/run_tests.js +++ b/test/run_tests.js @@ -12,44 +12,42 @@ 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 ...'"); } -console.log("typeof require (here)", typeof require); - -// We might need thins in the future ... -global.nodeRequire = function (modulePath) { - return require(modulePath); -}; - -global.require = global.nodeRequire; +let emsc = require("../lib/emscripten/libwrapper.js"); -let data = fs.readFileSync("lib/emscripten/libwrapper.js"); -vm.runInThisContext(data); - -// Do it here, since it breaks 'require'' +// 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' + } + } }); -let mod = System.newModule({Module: Module}); +instrument(System); + +let mod = System.newModule({Module: emsc}); let modName = System.normalizeSync(__dirname + "/../lib/emscripten/emsc"); console.log("registering", modName); System.set(modName, mod); - System.import("./test/tests/taler.js") .then((t) => { t.declareTests(assert, context, it); - run(); + setTimeout(run, 1); }) .catch((e) => { console.error("failed to load module", e.stack); }); - - |