-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: Migrate to Vitest from Jest. (#236)
* Remove jest dep. * Update tests. * Update babel plugins. * Update babel. * Update swc. * Update stuff. * More stuff. * Add fs layer. * Start on tests. * Share fs. * Update package. * Get examples working. * Include wrappers. * Handle assets via bundle. * Fix some tests. * Update outputs. * Update deps. * Fix more tests. * Update docs. * Fix test. * Fix script. * Add preset. * Fix test. * More fixes.
- Loading branch information
Showing
101 changed files
with
23,569 additions
and
10,776 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
This file was deleted.
Oops, something went wrong.
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
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
11 changes: 0 additions & 11 deletions
11
packages/babel-plugin-conditional-invariant/jest.config.js
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
1 change: 1 addition & 0 deletions
1
packages/babel-plugin-conditional-invariant/tests/plugin.test.ts
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 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
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 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
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import fs from 'node:fs'; | ||
import { json } from '@boost/common'; | ||
|
||
export interface FileSystem { | ||
copyFile: (from: string, to: string) => void; | ||
createDirAll: (path: string) => void; | ||
exists: (path: string) => boolean; | ||
readFile: (path: string) => string; | ||
readJson: <T>(path: string) => T; | ||
removeDir: (path: string) => void; | ||
removeFile: (path: string) => void; | ||
writeFile: (path: string, data: string) => void; | ||
writeJson: (path: string, data: unknown) => void; | ||
} | ||
|
||
export const nodeFileSystem: FileSystem = { | ||
copyFile: fs.copyFileSync, | ||
createDirAll: (path) => fs.mkdirSync(path, { recursive: true }), | ||
exists: (path) => fs.existsSync(path), | ||
readFile: (path) => fs.readFileSync(path, 'utf8'), | ||
readJson: (path) => json.parse(nodeFileSystem.readFile(path)), | ||
removeDir: (path) => { | ||
fs.rmSync(path, { recursive: true }); | ||
}, | ||
removeFile: fs.unlinkSync, | ||
writeFile: (path, data) => { | ||
fs.writeFileSync(path, `${data.trim()}\n`, 'utf8'); | ||
}, | ||
writeJson: (path, data) => { | ||
nodeFileSystem.writeFile(path, JSON.stringify(data, null, 2)); | ||
}, | ||
}; |
Oops, something went wrong.