You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -58,7 +57,7 @@ All the commands support these specific v8 options:
58
57
-`--es_staging`
59
58
60
59
```bash
61
-
$ egg-bin [command] --debug --es_staging
60
+
egg-bin [command] --debug --es_staging
62
61
```
63
62
64
63
if `process.env.NODE_DEBUG_OPTION` is provided (WebStorm etc), will use it as debug options.
@@ -68,7 +67,7 @@ if `process.env.NODE_DEBUG_OPTION` is provided (WebStorm etc), will use it as de
68
67
Start dev cluster on `local` env, it will start a master, an agent and a worker.
69
68
70
69
```bash
71
-
$ egg-bin dev
70
+
egg-bin dev
72
71
```
73
72
74
73
##### options
@@ -91,23 +90,22 @@ automatically detect the protocol, use the new `inspector` when the targeted run
91
90
if running without `VSCode` or `WebStorm`, we will use [inspector-proxy](https://github.com/whxaxes/inspector-proxy) to proxy worker debug, so you don't need to worry about reload.
92
91
93
92
```bash
94
-
$ egg-bin debug --debug-port=9229 --proxy=9999
93
+
egg-bin debug --debug-port=9229 --proxy=9999
95
94
```
96
95
97
96
##### options
98
97
99
98
- all `egg-bin dev` options is accepted.
100
99
-`--proxy=9999` worker debug proxy port.
101
100
102
-
103
101
### test
104
102
105
103
Using [mocha] to run test.
106
104
107
105
[power-assert] is the default `assert` library, and [intelli-espower-loader] will be auto required.
108
106
109
107
```bash
110
-
$ egg-bin test [files] [options]
108
+
egg-bin test [files] [options]
111
109
```
112
110
113
111
-`files` is optional, default to `test/**/*.test.js`
@@ -128,14 +126,14 @@ test
128
126
You can pass any mocha argv.
129
127
130
128
-`--require` require the given module
131
-
-`--grep` only run tests matching <pattern>
129
+
-`--grep` only run tests matching `<pattern>`
132
130
-`--timeout` milliseconds, default to 60000
133
131
-`--full-trace` display the full stack trace, default to false.
134
132
-`--typescript` / `--ts` enable typescript support, default to `false`.
135
133
-`--changed` / `-c` only test changed test files(test files means files that match `${pwd}/test/**/*.test.(js|ts)`)
136
-
-`--dry-run` / `-d` whether dry-run the test command, just show the command
134
+
-`--dry-run` / `-d` whether dry-run the test command, just show the command
137
135
-`--espower` / `-e` whether auto require intelli-espower-loader(js) or espower-typescript(ts) for power-assert, default to `true`.
138
-
- see more at https://mochajs.org/#usage
136
+
- see more at <https://mochajs.org/#usage>
139
137
140
138
#### environment
141
139
@@ -159,48 +157,121 @@ The test timeout can set by `TEST_TIMEOUT` env, default is `60000` ms.
159
157
TEST_TIMEOUT=2000 egg-bin test
160
158
```
161
159
160
+
### node-test
161
+
162
+
Using [node:test] to run test.
163
+
164
+
[power-assert] is the default `assert` library, and [intelli-espower-loader] will be auto required.
165
+
166
+
```bash
167
+
egg-bin node-test [files] [options]
168
+
```
169
+
170
+
-`files` is optional, default to `test/**/*.test.js`
171
+
-`test/fixtures`, `test/node_modules` is always exclude.
172
+
173
+
#### node-test options
174
+
175
+
-`--test-only` configures the test runner to only execute top level tests that have the only option set
176
+
177
+
TBD: TypeScript not support yet
178
+
179
+
#### environment
180
+
181
+
Environment is also support, will use it if options not provide.
182
+
183
+
You can set `TESTS` env to set the tests directory, it support [glob] grammar.
184
+
185
+
```bash
186
+
TESTS=test/a.test.js egg-bin node-test
187
+
```
188
+
189
+
And the reporter can set by the `TEST_REPORTER` env, default is `tap`.
190
+
191
+
```bash
192
+
TEST_REPORTER=doc egg-bin node-test
193
+
```
194
+
195
+
The test timeout can set by `TEST_TIMEOUT` env, default is `60000` ms.
196
+
197
+
```bash
198
+
TEST_TIMEOUT=2000 egg-bin node-test
199
+
```
200
+
162
201
### cov
163
202
164
-
Using [c8] to run code coverage, it support all test params above.
203
+
Using [mocha] and [c8] to run code coverage, it support all test params above.
165
204
166
205
Coverage reporter will output text-summary, json and lcov.
167
206
168
-
#### options
207
+
#### cov options
169
208
170
209
You can pass any mocha argv.
171
210
172
211
-`-x` add dir ignore coverage, support multiple argv
173
212
-`--prerequire` prerequire files for coverage instrument, you can use this options if load files slowly when call `mm.app` or `mm.cluster`
174
213
-`--typescript` / `--ts` enable typescript support, default to `false`, if true, will auto add `.ts` extension and ignore `typings` and `d.ts`.
175
214
-`--c8` c8 instruments passthrough. you can use this to overwrite egg-bin's default c8 instruments and add additional ones.
215
+
>
176
216
> - egg-bin have some default instruments passed to c8 like `-r` and `--temp-directory`
0 commit comments