diff options
author | Florian Dold <florian.dold@gmail.com> | 2016-04-27 15:06:56 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2016-04-27 15:07:01 +0200 |
commit | 004a0372abd42da19690d95b25ede5b0ffe10601 (patch) | |
tree | 88d9a43145d1b0ce742750d2762b387d3d6c7f25 /test | |
parent | 07715206e54cab23788e3167e5a77509ffd3e369 (diff) |
get test skeleton working again
Diffstat (limited to 'test')
-rw-r--r-- | test/run_tests.js | 21 | ||||
-rw-r--r-- | test/tests/taler.ts | 15 |
2 files changed, 6 insertions, 30 deletions
diff --git a/test/run_tests.js b/test/run_tests.js index f62810f7e..f6a623942 100644 --- a/test/run_tests.js +++ b/test/run_tests.js @@ -18,38 +18,25 @@ if ("function" !== typeof run) { throw Error("test must be run with 'mocha --delay ...'"); } -console.log("typeof require (here)", typeof require); +let emsc = require("../lib/emscripten/libwrapper.js"); -// We might need thins in the future ... -global.nodeRequire = function (modulePath) { - return require(modulePath); -}; - -global.require = global.nodeRequire; - -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 }); -let mod = System.newModule({Module: Module}); +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); }); - - diff --git a/test/tests/taler.ts b/test/tests/taler.ts index 14130f9af..941e8284d 100644 --- a/test/tests/taler.ts +++ b/test/tests/taler.ts @@ -5,20 +5,9 @@ declare var HttpMockLib; export function declareTests(assert, context, it) { - it("works!", function() { + it("calls native emscripten code", function() { let x = new Emsc.Amount({value: 42, fraction: 42, currency: "EUR"}); let j = x.toJson(); assert("value" in j); }); - - - it("retries", function() { - let m = new HttpMockLib(); - /*m.intercept() - .matchUrlContains() - .counterEquals(0) - .count() - .sen*/ - }) - -}
\ No newline at end of file +} |