mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 12:19:15 +00:00
21 lines
440 B
JavaScript
21 lines
440 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);
|
|
assert(JSON.parse(ret.program).body.length == 1);
|
|
assert(ret.errors.length == 0);
|
|
assert(ret.comments.length == 1);
|
|
}
|
|
|
|
const sourceText = "/* comment */ foo";
|
|
|
|
test(oxc.parseSync(sourceText));
|
|
|
|
async function main() {
|
|
test(await oxc.parseAsync(sourceText));
|
|
}
|
|
|
|
main()
|