Skip to content

Commit 5e36830

Browse files
committed
Fix esm tests
1 parent 252db15 commit 5e36830

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

.github/workflows/test-js.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- uses: oven-sh/setup-bun@4bc047ad259df6fc24a6c9b0f9a0cb08cf17fbe5 # v2.0.1
1313
- run: bun install
1414
- run: bun run build
15-
- run: bun index.test.js
15+
- run: bun test/index.test.js
1616
deno:
1717
name: Deno
1818
runs-on: ubuntu-latest
@@ -21,7 +21,7 @@ jobs:
2121
- uses: denoland/setup-deno@909cc5acb0fdd60627fb858598759246509fa755 # v2.0.2
2222
- run: deno install
2323
- run: deno run build
24-
- run: deno --allow-env --allow-write --allow-read index.test.js
24+
- run: deno --allow-env --allow-write --allow-read test/index.test.js
2525
lint:
2626
name: Lint
2727
runs-on: ubuntu-latest

package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "readdirp",
33
"description": "Recursive version of fs.readdir with small RAM & CPU footprint.",
4-
"version": "4.1.0",
4+
"version": "4.1.1",
55
"homepage": "https://github.com/paulmillr/readdirp",
66
"repository": {
77
"type": "git",
@@ -48,10 +48,10 @@
4848
],
4949
"scripts": {
5050
"build": "tsc && tsc -p tsconfig.esm.json",
51-
"lint": "prettier --check index.ts index.test.js",
52-
"format": "prettier --write index.ts index.test.js",
53-
"test": "node index.test.js",
54-
"test:coverage": "c8 node index.test.js"
51+
"lint": "prettier --check index.ts test/index.test.js",
52+
"format": "prettier --write index.ts test/index.test.js",
53+
"test": "node test/index.test.js",
54+
"test:coverage": "c8 node test/index.test.js"
5555
},
5656
"devDependencies": {
5757
"@paulmillr/jsbt": "0.2.1",

index.test.js test/index.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { describe, it } from 'micro-should';
66
import { tmpdir } from 'node:os';
77
import chai from 'chai';
88
import chaiSubset from 'chai-subset';
9-
import { readdirp, readdirpPromise, ReaddirpStream } from './esm/index.js';
9+
import { readdirp, readdirpPromise, ReaddirpStream } from '../esm/index.js';
1010

1111
chai.use(chaiSubset);
1212
chai.should();
@@ -94,7 +94,7 @@ describe('readdirp', () => {
9494

9595
it('handles symlinked directories', async () => {
9696
await beforeEach();
97-
const originalPath = sysPath.join(__dirname, 'esm');
97+
const originalPath = sysPath.join(__dirname, '..', 'esm');
9898
const originalFiles = await readdir(originalPath);
9999
const newPath = sysPath.join(currPath, 'esm');
100100
await symlink(originalPath, newPath);

test/package.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "module",
3+
"browser": {
4+
"crypto": false,
5+
"./crypto": "./esm/cryptoBrowser.js"
6+
}
7+
}

0 commit comments

Comments
 (0)