diff options
Diffstat (limited to 'extension/test')
-rw-r--r-- | extension/test/run_tests.js | 55 | ||||
-rw-r--r-- | extension/test/tests/taler.ts | 24 |
2 files changed, 0 insertions, 79 deletions
diff --git a/extension/test/run_tests.js b/extension/test/run_tests.js deleted file mode 100644 index f62810f7e..000000000 --- a/extension/test/run_tests.js +++ /dev/null @@ -1,55 +0,0 @@ - -/** - * Bridge between the mocha test runner / nodejs - * and the typescript / the wallet's module system. - * - * The test cases use better-assert as assert library - * with mocha's bdd UI. - */ - -"use strict"; - -let assert = require("better-assert"); -let vm = require("vm"); -let fs = require("fs"); - - -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 data = fs.readFileSync("lib/emscripten/libwrapper.js"); -vm.runInThisContext(data); - -// Do it here, since it breaks 'require'' -let System = require("systemjs"); - -System.config({ - defaultJSExtensions: true -}); - -let mod = System.newModule({Module: Module}); -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(); - }) - .catch((e) => { - console.error("failed to load module", e.stack); - }); - - diff --git a/extension/test/tests/taler.ts b/extension/test/tests/taler.ts deleted file mode 100644 index 14130f9af..000000000 --- a/extension/test/tests/taler.ts +++ /dev/null @@ -1,24 +0,0 @@ -import * as Emsc from '../../lib/wallet/emscriptif'; - - -declare var HttpMockLib; - -export function declareTests(assert, context, it) { - - it("works!", 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 |