-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: replace old programmatic API with one matching the CLI commands
- Loading branch information
Showing
21 changed files
with
682 additions
and
378 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'clean-modules': major | ||
--- | ||
|
||
**BREAKING** Replace old programmatic API with one that better correspond to the CLI commands. See the README for information on how to import them. |
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
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import { fs } from 'memfs'; | ||
|
||
module.exports = fs | ||
module.exports = 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,16 @@ | ||
import { expect } from 'vitest'; | ||
|
||
export function enableAbsolutePathSnapshotSerializer(cwd: string = process.cwd()) { | ||
const cwdRegex = new RegExp(cwd, 'g'); | ||
|
||
expect.addSnapshotSerializer({ | ||
serialize(val, config, indentation, depth, refs, printer) { | ||
const snapshot = printer(val, config, indentation, depth, refs); | ||
return snapshot.replace(cwdRegex, '/absolute-test-path'); | ||
}, | ||
test(val) { | ||
const containsAbsolutePath = cwdRegex.test(JSON.stringify(val)); | ||
return containsAbsolutePath; | ||
}, | ||
}); | ||
} |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.