mirror of
https://github.com/danbulant/oxc
synced 2026-05-21 21:29:01 +00:00
- Added TypeScript annotation for `ParseResult.program` - Modified the entrypoint for `oxc-parser` to allow wrapping the napi functions - Updated `index.js` to parse the `program` string into a JSON object - Updated tests - Added a dependency on `@oxc/types`
17 lines
410 B
JavaScript
17 lines
410 B
JavaScript
import { assert, describe, it } from 'vitest';
|
|
|
|
import * as oxc from '../index.js';
|
|
|
|
describe('module lexer', () => {
|
|
const code = 'export { foo }';
|
|
|
|
it('matches output', () => {
|
|
const ret = oxc.moduleLexerSync(code);
|
|
assert(ret.exports.length == 1);
|
|
});
|
|
|
|
it('matches output async', async () => {
|
|
const ret = await oxc.moduleLexerAsync(code);
|
|
assert(ret.exports.length == 1);
|
|
});
|
|
});
|