oxc/napi/resolver/test.mjs
2023-11-10 15:25:17 +00:00

14 lines
425 B
JavaScript

import path from 'path';
import resolve, { ResolverFactory } from './index.js';
import assert from 'assert';
console.log(`Testing on ${process.platform}-${process.arch}`)
const cwd = process.cwd();
// `resolve`
assert(resolve.sync(cwd, "./index.js").path, path.join(cwd, 'index.js'));
// `ResolverFactory`
const resolver = new ResolverFactory();
assert(resolver.sync(cwd, "./index.js").path, path.join(cwd, 'index.js'));