waforth/tests/index-node.js

12 lines
360 B
JavaScript
Raw Normal View History

2019-03-10 14:32:41 +01:00
/* global __dirname, Buffer */
2019-03-10 10:37:01 +01:00
const fs = require("fs");
const path = require("path");
require("@babel/register")({
presets: ["@babel/preset-env"]
});
const loadTests = require("./tests.js").default;
const wasmModule = fs.readFileSync(path.join(__dirname, "../src/waforth.wasm"));
2019-03-10 14:32:41 +01:00
loadTests(wasmModule, s => {
return Buffer.from(s).toString("base64");
});