@exodus/test 1.0.0-rc.29 → 1.0.0-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,44 +1,18 @@
1
1
  # @exodus/test
2
2
 
3
- A runner for `node:test`, `jest`, and `tape` test suites on top of `node:test`
4
-
5
3
  Most likely it will just work on your simple jest tests as as drop-in replacement
6
4
 
7
- Comes with typescript support, optional esm/cjs interop, and also loading babel transforms!
8
-
9
- Use `--coverage` to generate coverage output
10
-
11
- Default `NODE_ENV` value is "test", use `NODE_ENV=` to override (e.g. to empty)
12
-
13
5
  ## Library
14
6
 
15
- ### Using with `node:test` natively
16
-
17
- You can just use pure [`node:test`](https://nodejs.org/api/test.html) in your tests,
18
- this runner is fully compatible with that (and will set version-specific options for you)!
19
-
20
7
  ### Moving from jest
21
8
 
22
- ```js
23
- import {
24
- jest,
25
- expect,
26
- describe,
27
- it,
28
- beforeEach,
29
- afterEach,
30
- beforeAll,
31
- afterAll,
32
- } from '@exodus/test/jest'
33
- ```
34
-
35
- Or, run with [`--jest` option](#options) to register jest globals
9
+ `import { describe, it, assert, jest, expect } from '@exodus/test'`
36
10
 
37
11
  ### Moving from tap/tape
38
12
 
39
- ```js
40
- import test from '@exodus/test/tap'
41
- ```
13
+ `import { tap as test } from '@exodus/test'`
14
+
15
+ Not all features might be supported
42
16
 
43
17
  ### Running tests asynchronously
44
18
 
@@ -46,34 +20,41 @@ Add `{ concurrency: true }`, like this: `describe('my testsuite', { concurrency:
46
20
 
47
21
  ### List of exports
48
22
 
49
- - `@exodus/test/jest` -- `jest` mock
23
+ Adapters:
24
+
25
+ - `jest` -- jest mock adapter
26
+ - `tap` -- tap/tape adapter
27
+ - `mock`
50
28
 
51
- - `@exodus/test/tape` -- `tape` mock (can also be helpful when moving from `tap`)
29
+ Assertions:
30
+
31
+ - `assert` -- alias for `node:assert/strict`
32
+ - `expect` -- expect with additional features for function mocks
33
+
34
+ Suite:
35
+
36
+ - `describe`
37
+ - `test`
38
+ - `it` -- alias for `test`
39
+ - `beforeEach`
40
+ - `afterEach`
41
+ - `before` -- alias for `beforeAll`
42
+ - `after` -- alias for `afterAll`
52
43
 
53
44
  ## Binary
54
45
 
55
- Just use `"test": "exodus-test"`
46
+ Just use `"test: "exodus-test"`
56
47
 
57
48
  ### Options
58
49
 
59
- - `--jest` -- register jest test helpers as global variables, also load `jest.config.*` configuration options
50
+ - `--global` -- register all test helpers as global variables
60
51
 
61
- - `--esbuild` -- use esbuild loader, also enables Typescript support
52
+ - `--typescript` -- enable typescript support
62
53
 
63
- - `--babel` -- use babel loader (slower than `--esbuild`, makes sense if you have a special config)
54
+ - `--babel` -- enable babel support
64
55
 
65
56
  - `--coverage` -- enable coverage, prints coverage output (varies by coverage engine)
66
57
 
67
58
  - `--coverage-engine c8` -- use c8 coverage engine (default), also generates `./coverage/` dirs
68
59
 
69
60
  - `--coverage-engine node` -- use Node.js builtint coverage engine
70
-
71
- - `--watch` -- operate in watch mode and re-run tests on file changes
72
-
73
- - `--only` -- only run the tests marked with `test.only`
74
-
75
- - `--passWithNoTests` -- do not error when no test files were found
76
-
77
- - `--write-snapshots` -- write snapshots instead of verifying them (has `--test-update-snapshots` alias)
78
-
79
- - `--test-force-exit` -- force exit after tests are done (useful in integration tests where it could be unfeasible to resolve all open handles)