Skip to content

Commit

Permalink
Added node.js build specific tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
texodus committed May 1, 2018
1 parent 7b04229 commit bf372b8
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions packages/perspective/test/js/perspective.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

const perspective = require('../../src/js/perspective.js');
const load_asmjs = require("../../build/asmjs/psp.js").load_perspective;
const node_perspective = require("../../src/js/perspective.node.js");
const fs = require('fs');

const RUNTIMES = {
Expand All @@ -18,17 +19,12 @@ const RUNTIMES = {
asmjsCodeFile: "asmjs/psp.js",
ENVIRONMENT: "NODE"
})),
WASM: {}
WASM: {},
NODE: node_perspective
}

if (typeof WebAssembly !== "undefined") {
const load_wasm = require("../../build/wasm_sync/psp.js").load_perspective;
const wasm = fs.readFileSync('./build/wasm_sync/psp.wasm');
RUNTIMES["WASM"] = perspective(load_wasm({
wasmBinary: wasm,
wasmJSMethod: 'native-wasm',
ENVIRONMENT: "NODE"
}));
RUNTIMES["WASM"] = perspective(require("../../build/wasm_sync/psp.js"));
}

const constructor_tests = require("./constructors.js");
Expand Down

0 comments on commit bf372b8

Please sign in to comment.