oxc/crates/oxc_napi/test.mjs
Boshen d49195f7f2
feat: napi (#302)
* chore: only ignore js files from the root

* feat: napi
2023-04-22 14:41:45 +08:00

19 lines
376 B
JavaScript

import oxc from './index.js';
import assert from 'assert';
console.log(`Testing on ${process.platform}-${process.arch}`)
function test(ret) {
console.log(ret.program);
console.log(ret.errors);
assert(ret.program.body.length == 1);
assert(ret.errors.length == 0);
}
test(oxc.parseSync("foo"));
async function main() {
test(await oxc.parseAsync("foo"));
}
main()