-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Following discussion in #142 , this adds an explicit check for `"node:test"` to `BUILTIN_MODULES_REGEX_STR` in order to properly group it with other builtin modules. Test covers: - `"node:test"` correctly gets grouped in with other builtin node modules - `"node:test"` is correctly sorted among other builtin node modules - `"*node:test"` is NOT grouped in with builtin modules - `"node:test*"` is NOT grouped in with builtin modules - `"node"` is NOT grouped in with builtin modules - `"test"` is NOT grouped in with builtin modules Fixes #142
- Loading branch information
1 parent
539e23d
commit 8541bb8
Showing
4 changed files
with
51 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
tests/BuiltinModulesNodeTest/__snapshots__/ppsi.spec.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html | ||
|
||
exports[`groups-node-test-with-builtin-modules.js - typescript-verify > groups-node-test-with-builtin-modules.js 1`] = ` | ||
import nodeUtil from 'node:util'; | ||
import nodeNodeTestTest from 'node:node:test:test'; | ||
import nodeNodeTest from 'node:node:test'; | ||
import nodeTestTest from 'node:test:test'; | ||
import nodeTest from 'node:test'; | ||
import test from 'test' | ||
import node from 'node'; | ||
import fs from 'fs'; | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
import fs from "fs"; | ||
import nodeTest from "node:test"; | ||
import nodeUtil from "node:util"; | ||
import node from "node"; | ||
import nodeNodeTest from "node:node:test"; | ||
import nodeNodeTestTest from "node:node:test:test"; | ||
import nodeTestTest from "node:test:test"; | ||
import test from "test"; | ||
`; |
10 changes: 10 additions & 0 deletions
10
tests/BuiltinModulesNodeTest/groups-node-test-with-builtin-modules.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import nodeUtil from 'node:util'; | ||
|
||
import nodeNodeTestTest from 'node:node:test:test'; | ||
import nodeNodeTest from 'node:node:test'; | ||
import nodeTestTest from 'node:test:test'; | ||
import nodeTest from 'node:test'; | ||
import test from 'test' | ||
import node from 'node'; | ||
|
||
import fs from 'fs'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import {run_spec} from '../../test-setup/run_spec'; | ||
|
||
run_spec(__dirname, ["typescript"], { | ||
importOrder: [ | ||
"", | ||
"<BUILTIN_MODULES>", | ||
"", | ||
"<THIRD_PARTY_MODULES>", | ||
"", | ||
"^[.]", | ||
], | ||
}); |