Skip to content

Commit cd9f640

Browse files
committed
#146: only tests module resolution 16 if not windows
1 parent 90085d7 commit cd9f640

File tree

3 files changed

+30
-22
lines changed

3 files changed

+30
-22
lines changed

.github/workflows/nodejs.yml

+18-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
name: build
22

3-
on: [push]
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
410

511
jobs:
612
build:
@@ -14,16 +20,24 @@ jobs:
1420
steps:
1521
- uses: actions/checkout@v1
1622
- name: Use Node.js ${{ matrix.node-version }}
17-
uses: actions/setup-node@v1
23+
uses: actions/setup-node@v4
1824
with:
1925
node-version: ${{ matrix.node-version }}
20-
- name: npm install, build, and test
26+
- name: npm install, build, and linting
2127
run: |
2228
npm install
2329
npm run build --if-present
24-
npm test
30+
npm run lint
31+
npm run test:ts
2532
env:
2633
CI: true
34+
- name: test nodeResolution 16
35+
if: runner.os != 'Windows'
36+
run: |
37+
npm run test:16
38+
- name: cases
39+
run: |
40+
npm run test:cases
2741
- name: upload to codecov
2842
if: runner.os == 'Linux'
2943
uses: codecov/codecov-action@v5

README.md

-14
Original file line numberDiff line numberDiff line change
@@ -384,20 +384,6 @@ ignore({
384384

385385
# Upgrade Guide
386386

387-
## Upgrade 5.x -> 6.x
388-
389-
To bring better compatibility for TypeScript with `moduleResolution:Node16`, `ignore.isPathValid` has been removed in TypeScript definitions since `6.x`
390-
391-
```js
392-
// < 6, or works with commonjs
393-
ignore.isPathValid('./foo') // false
394-
395-
// >= 6.x
396-
import {isPathValid} from 'ignore'
397-
398-
isPathValid('./foo') // false
399-
```
400-
401387
## Upgrade 4.x -> 5.x
402388

403389
Since `5.0.0`, if an invalid `Pathname` passed into `ig.ignores()`, an error will be thrown, unless `options.allowRelative = true` is passed to the `Ignore` factory.

package.json

+12-4
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,28 @@
1212
"scripts": {
1313
"prepublishOnly": "npm run build",
1414
"build": "babel -o legacy.js index.js",
15-
"test:lint": "eslint .",
15+
16+
"==================== linting ======================": "",
17+
"lint": "eslint .",
18+
19+
"=================== typescript ====================": "",
20+
"ts": "npm run test:ts && npm run test:16",
1621
"test:ts": "ts-node ./test/ts/simple.ts",
22+
"test:16": "npm run test:ts:16 && npm run test:cjs:16 && npm run test:mjs:16",
1723
"test:ts:16": "ts-node --compilerOptions '{\"moduleResolution\": \"Node16\", \"module\": \"Node16\"}' ./test/ts/simple.ts",
1824
"test:cjs:16": "ts-node --compilerOptions '{\"moduleResolution\": \"Node16\", \"module\": \"Node16\"}' ./test/ts/simple.cjs",
1925
"test:mjs:16": "ts-node --compilerOptions '{\"moduleResolution\": \"Node16\", \"module\": \"Node16\"}' ./test/ts/simple.mjs",
26+
27+
"===================== cases =======================": "",
28+
"test:cases": "npm run tap test/*.test.js -- --coverage",
2029
"tap": "tap --reporter classic",
2130
"test:git": "npm run tap test/git-check-ignore.test.js",
2231
"test:ignore": "npm run tap test/ignore.test.js",
2332
"test:ignore:only": "IGNORE_ONLY_IGNORES=1 npm run tap test/ignore.test.js",
2433
"test:others": "npm run tap test/others.test.js",
25-
"test:cases": "npm run tap test/*.test.js -- --coverage",
2634
"test:no-coverage": "npm run tap test/*.test.js -- --no-check-coverage",
27-
"test:only": "npm run test:lint && npm run build && npm run test:ts && npm run test:ts:16 && npm run test:cjs:16 && npm run test:mjs:16 && npm run test:cases",
28-
"test": "npm run test:only",
35+
36+
"test": "npm run lint && npm run ts && npm run build && npm run test:cases",
2937
"test:win32": "IGNORE_TEST_WIN32=1 npm run test",
3038
"report": "tap --coverage-report=html"
3139
},

0 commit comments

Comments
 (0)