sxy-test-runner 1.0.8 → 1.0.11
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/package.json +1 -1
- package/readme.md +11 -11
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Mocha-like test runner for **es modules** (only), with **watch mode**, and **re-running only tests related to changes** (by dependency analysis)
|
|
4
4
|
|
|
5
|
-
```
|
|
5
|
+
```js
|
|
6
6
|
import { describe } from 'sxy-test-runner'
|
|
7
7
|
import { should as setupShould } from 'chai'
|
|
8
8
|
const should = setupShould()
|
|
@@ -24,19 +24,19 @@ describe('The add() function', ({it}) => {
|
|
|
24
24
|
### 1. Install
|
|
25
25
|
|
|
26
26
|
```
|
|
27
|
-
npm i sxy-test-runner
|
|
27
|
+
npm i -D sxy-test-runner
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
or
|
|
30
|
+
*or*
|
|
31
31
|
|
|
32
32
|
```
|
|
33
|
-
yarn add sxy-test-runner
|
|
33
|
+
yarn add -D sxy-test-runner
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
or
|
|
36
|
+
*or*
|
|
37
37
|
|
|
38
38
|
```
|
|
39
|
-
pnpm add sxy-test-runner
|
|
39
|
+
pnpm add -D sxy-test-runner
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
---
|
|
@@ -52,7 +52,7 @@ This will create a config in your project folder. It can be moved to a folder na
|
|
|
52
52
|
|
|
53
53
|
### 3. Modify the config, specifying the base path for tests and code to watch, and glob patterns for tests and code to watch
|
|
54
54
|
|
|
55
|
-
```
|
|
55
|
+
```js
|
|
56
56
|
{
|
|
57
57
|
// base folder for tests matching and ignore patterns
|
|
58
58
|
testsBase: 'dist',
|
|
@@ -106,7 +106,7 @@ Because of this, be careful with globals, which will be shared.
|
|
|
106
106
|
|
|
107
107
|
## Execution modes
|
|
108
108
|
|
|
109
|
-
|
|
109
|
+
**execution** settings let you choose whether to run test files, describe blocks, and individual tests sequentially or in parallel.
|
|
110
110
|
|
|
111
111
|
If working with globals you may want to use sequential only, to avoid conflicts on those globals.
|
|
112
112
|
|
|
@@ -142,7 +142,7 @@ Edit config.beforeEachFile / config.beforeEachDescribe / config.beforeEachTest w
|
|
|
142
142
|
|
|
143
143
|
If a file exports named values, or a function returns an object with properties, these keys will be added to a storage object (beware of conflicting names). This object is then passed to the afterEachFile / afterEachDescribe / afterEachTest tasks for cleanup.
|
|
144
144
|
|
|
145
|
-
```
|
|
145
|
+
```js
|
|
146
146
|
// tasks to run before each test file is run
|
|
147
147
|
beforeEachFile: () => {
|
|
148
148
|
const thing = prepSomething()
|
|
@@ -161,7 +161,7 @@ Not yet implemented.
|
|
|
161
161
|
|
|
162
162
|
## 4. Run code before each test, after each test, or after the describe block - per describe block
|
|
163
163
|
|
|
164
|
-
```
|
|
164
|
+
```js
|
|
165
165
|
import { describe } from 'sxy-test-runner'
|
|
166
166
|
import { should as setupShould } from 'chai'
|
|
167
167
|
const should = setupShould()
|
|
@@ -203,4 +203,4 @@ describe('something', ({it, beforeEachTest, afterEachTest, afterDescribe}) => {
|
|
|
203
203
|
|
|
204
204
|
# Known issues
|
|
205
205
|
|
|
206
|
-
|
|
206
|
+
sxy-loader uses eval to load and re-load modules, and this makes a big mess of error output. I am hoping for a solution to module reloading in the official spec to solve this. It may be possible to switch to a different method of re-loading modules to solve this (no plans for this just now).
|