@@ -31,30 +31,36 @@ In your `package.json` you can use the scripts:
31
31
}
32
32
```
33
33
34
- You will also need to install ` typescript ` for building and ` @jest/globals ` for testing.
34
+ You will also need to install ` typescript ` for building and ` vitest ` for testing.
35
35
36
36
### Batteries Included
37
37
38
- - ` install ` - Installs ` husky ` and ` lint-staged `
39
- - ` lint ` - Uses ` eslint --fix `
40
- - ` format ` - Uses ` prettier --write `
41
- - ` specs ` - Uses ` jest `
38
+ - ` install ` - Installs ` husky ` and ` lint-staged ` for git commit hooks
39
+ - ` lint ` - Uses ` eslint --fix ` on all supported files in ` src ` (i.e. ` js ` , ` jsx ` , ` ts ` , ` tsx ` )
40
+ - ` format ` - Uses ` prettier --write ` on all supported files in ` src ` and the root directory
41
+ - ` specs ` - Uses ` vitest ` to run test files match ` *.{test,spec}.* ` files
42
+ - ` --watch <index> ` Runs vitest in watch mode on the config at ` <index> `
43
+ - ` --update ` Updates the snapshot files
44
+ - ` --changed ` Runs tests on only changed files
45
+ - ` --since <commit> ` Runs tests on files changed since ` <commit> `
46
+ - ` --test-pattern ` Runs tests matching the specified pattern
42
47
- ` build ` - Uses ` rimraf ` and ` tsc `
43
- - ` check ` - Uses ` eslint ` and ` prettier --check `
48
+ - ` check ` - Uses ` eslint ` , ` prettier --check ` , and ` tsc ` on each test "project"
44
49
- ` test ` - Runs ` check ` , ` specs ` , and ` build `
45
50
46
51
### Configuration
47
52
48
53
Configuration can get specified in your ` package.json ` file under ` ts-scripts ` :
49
54
50
- - ` src ` - An array of source directories to read (default: ` ["src"] ` )
51
- - ` dist ` - An array of output directories to clean, i.e. ` outDir ` in ` tsconfig.json ` (default: ` ["dist"] ` )
52
- - ` project ` An array of ` tsconfig.json ` project files for TypeScript (default: ` ["tsconfig.json"] ` )
55
+ - ` src ` - An array of source directories used for ` format ` and ` lint ` (default: ` ["src"] ` )
56
+ - ` dist ` - An array of output directories to clean before ` build ` (default: ` ["dist"] ` )
57
+ - ` project ` An array of ` tsconfig.json ` project files to build using TypeScript (default: ` ["tsconfig.json"] ` )
53
58
- ` test ` An array of test configuration objects (default: ` [{}] ` )
54
- - ` name ` The name of this test configuration (default: ` undefined ` )
55
- - ` dir ` An array of directories to read tests from (default: ` src ` )
56
- - ` env ` The environment to use for these tests (default: ` "node" ` )
57
- - ` project ` The ` tsconfig.json ` project file to use for this test (default: ` "tsconfig.json" ` )
59
+ - ` dir ` The directory to read tests from (default: ` undefined ` , root directory)
60
+ - ` config ` The configuration file to use for this test (default: ` undefined ` , discovered by ` vitest ` )
61
+ - ` project ` The ` tsconfig.json ` project file to use for type checking (default: ` "tsconfig.json" ` )
62
+
63
+ Specific configuration can be disabled for customized configuration by setting ` src ` , ` dist ` , ` project ` , or ` test ` to an empty array.
58
64
59
65
## License
60
66
0 commit comments