1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
--- a/test.js
+++ b/test.js
@@ -1,5 +1,6 @@
import path from 'node:path';
-import test from 'ava';
+import test from 'node:test';
+import { equal as is, deepEqual } from 'node:assert';
import {readPackageUp, readPackageUpSync} from './index.js';
const cwd = 'fixture';
@@ -7,24 +8,24 @@
test('async', async t => {
const result = await readPackageUp({cwd});
- t.is(result.packageJson.name, 'read-package-up');
- t.is(result.path, packagePath);
- t.deepEqual(
+ is(result.packageJson.name, 'read-package-up');
+ is(result.path, packagePath);
+ deepEqual(
await readPackageUp({cwd: new URL(cwd, import.meta.url)}),
result,
);
- t.is(await readPackageUp({cwd: '/'}), undefined);
+ is(await readPackageUp({cwd: '/'}), undefined);
});
test('sync', t => {
const result = readPackageUpSync({cwd});
- t.is(result.packageJson.name, 'read-package-up');
- t.is(result.path, packagePath);
- t.deepEqual(
+ is(result.packageJson.name, 'read-package-up');
+ is(result.path, packagePath);
+ deepEqual(
readPackageUpSync({cwd: new URL(cwd, import.meta.url)}),
result,
);
- t.is(readPackageUpSync({cwd: '/'}), undefined);
+ is(readPackageUpSync({cwd: '/'}), undefined);
});
|