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
To enable an MS Teams notification upon the completion (successful or not) of the deploy process, create a [MS Teams Webhook](https://docs.microsoft.com/en-us/microsoftteams/platform/concepts/connectors/connectors-using#setting-up-a-custom-incoming-webhook) and add the incoming webhook url as the `MS_TEAMS_WEBHOOK` key/value to your `env.yml`.
Run [Flow](https://flow.org/). Must have a `.flowconfig` in the current working directory and a `// @flow` annotation at the top of each file you want to check. See the Flow website for documentation.
Run the [Jest](http://facebook.github.io/jest/) test runner on your project. By default, mastarm will run Jest and generate coverage reports on all .js files in the `lib` folder of your project. The `patterns` argument will make Jest run only tests whose filename match the provided pattern.
210
+
Run the [Jest](http://facebook.github.io/jest/) test runner on your project.
203
211
204
212
```shell
205
213
$ mastarm test
@@ -210,17 +218,51 @@ Run tests using Jest
210
218
211
219
Options:
212
220
213
-
-h, --help output usage information
214
-
-u, --update-snapshots Force update of snapshots. USE WITH CAUTION.
215
-
--coverage Run Jest with coverage reporting
216
-
--coverage-paths <paths> Extra paths to collect code coverage from
217
-
--jest-cli-args <args> Extra arguments to pass directly to the Jest Cli. Make sure to encapsulate all extra arguments in quote
218
-
--no-cache Run Jest without cache (defaults to using cache)
219
-
--run-in-band Run all tests serially in the current process
220
-
--setup-files <paths> Setup files to run before each test
221
-
--test-environment <env> Jest test environment to use (Jest default is jsdom)
222
-
--test-path-ignore-patterns <patterns> File patterns to ignore when scanning fortest files
-u, --update-snapshots Force update of snapshots. USE WITH CAUTION.
224
+
--coverage Run Jest with coverage reporting
225
+
--coverage-paths <paths> Extra paths to collect code coverage from in addition to the mastarm default of `lib/**/*.js`
226
+
--custom-config-file <path> Override the Jest config with the values found in a file path relative to the current working directory
227
+
--force-exit Force Jest to exit after all tests have completed running.
228
+
--jest-cli-args <args> Extra arguments to pass directly to the Jest Cli. Make sure to encapsulate all extra arguments in quotes
229
+
--no-cache Run Jest without cache (defaults to using cache)
230
+
--run-in-band Run all tests serially in the current process. This is always set to truewhile running on in a continuous integration environment.
231
+
--setup-files <paths> Setup files to run before each test
232
+
--test-environment <env> Jest test environment to use (Jest default is jsdom)
233
+
--test-path-ignore-patterns <patterns> File patterns to ignore when scanning fortest files
234
+
-h, --help output usage information
235
+
236
+
```
237
+
238
+
By default, mastarm will run Jest with most of the defaults in place. The defaults that mastarm adds include:
239
+
240
+
- some transforms needed to read certain .js files and also YAML files.
241
+
- ignoring the test path directory `__tests__/test-utils`
242
+
- setting the [testURL](https://jestjs.io/docs/en/configuration#testurl-string) to `http://localhost:9966`
243
+
- turning on [notifications](https://jestjs.io/docs/en/configuration#notify-boolean) of test completion
244
+
245
+
If the `coverage` flag is set to true, mastarm will automatically generate coverage reports of all .js files in the `lib` folder and will save the reports to the `coverage` folder.
223
246
247
+
The `patterns` argument will make Jest run only tests whose filename match the provided pattern.
248
+
249
+
There are a number of ways to set the [Jest config](https://jestjs.io/docs/en/configuration). The first is by adding a `jest` object to the package.json of the project. A number of other mastarm options will override the config. And finally, it is possible to use a custom config file (either .json or .js) via the `--custom-config-file` option. The config values are set and potentially overridden in the following order:
250
+
251
+
1. mastarm defaults.
252
+
2. Options in the `jest` object of the project's package.json file.
253
+
3. The values specified in the mastarm arguments `--coverage-paths`, `--setup-files`, `--test-environment` and `--test-path-ignore-patterns`
254
+
4. Options set in a custom config file specified in the mastarm argument `--custom-config-file`.
255
+
256
+
Here is an example of how to set the config using a custom file:
257
+
258
+
```shell
259
+
mastarm test --custom-config-file __tests__/test-utils/mocks/mock-jest-config.json
260
+
```
261
+
262
+
It is also possible to override any [Jest CLI Options](https://jestjs.io/docs/en/cli) by setting the `--jest-cli-args` flag. Ex:
263
+
264
+
```shell
265
+
mastarm test --jest-cli-args "--json --outputFile e2e-test-results/results.json"
0 commit comments