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
Over the last few years we've increased the number of test runners.
Entry points by test type have become too lage of a category for unique
names, so this moves top level test scripts under yarn and replaces test
types with the runner name.
e.g. `yarn test:browser` -> `yarn test:karma`
Closes#41133
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
yarn test:ftr:runner --config test/api_integration/config.js --grep='should return 404 if id does not match any sample data sets'
486
486
```
487
487
488
488
### Debugging Unit Tests
489
489
490
490
The standard `yarn test` task runs several sub tasks and can take several minutes to complete, making debugging failures pretty painful. In order to ease the pain specialized tasks provide alternate methods for running the tests.
491
491
492
-
To execute both server and browser tests, but skip linting, use `yarn test:quick`.
493
-
494
-
```bash
495
-
yarn test:quick
496
-
```
497
-
498
-
Use `yarn test:mocha` when you want to run the mocha tests.
499
-
500
-
```bash
501
-
yarn test:mocha
502
-
```
503
-
504
-
When you'd like to execute individual server-side test files, you can use the command below. Note that this command takes care of configuring Mocha with Babel compilation for you, and you'll be better off avoiding a globally installed `mocha` package. This command is great for development and for quickly identifying bugs.
505
-
506
-
```bash
507
-
node scripts/mocha <file>
508
-
```
509
-
510
492
You could also add the `--debug` option so that `node` is run using the `--debug-brk` flag. You'll need to connect a remote debugger such as [`node-inspector`](https://github.com/node-inspector/node-inspector) to proceed in this mode.
511
493
512
494
```bash
513
495
node scripts/mocha --debug <file>
514
496
```
515
497
516
-
With `yarn test:browser`, you can run only the browser tests. Coverage reports are available for browser tests by running `yarn test:coverage`. You can find the results under the `coverage/` directory that will be created upon completion.
498
+
With `yarn test:karma`, you can run only the browser tests. Coverage reports are available for browser tests by running `yarn test:coverage`. You can find the results under the `coverage/` directory that will be created upon completion.
517
499
518
500
```bash
519
-
yarn test:browser
501
+
yarn test:karma
520
502
```
521
503
522
-
Using `yarn test:dev` initializes an environment for debugging the browser tests. Includes an dedicated instance of the kibana server for building the test bundle, and a karma server. When running this task the build is optimized for the first time and then a karma-owned instance of the browser is opened. Click the "debug" button to open a new tab that executes the unit tests.
504
+
Using `yarn test:karma:debug` initializes an environment for debugging the browser tests. Includes an dedicated instance of the kibana server for building the test bundle, and a karma server. When running this task the build is optimized for the first time and then a karma-owned instance of the browser is opened. Click the "debug" button to open a new tab that executes the unit tests.
523
505
524
506
```bash
525
-
yarn test:dev
507
+
yarn test:karma:debug
526
508
```
527
509
528
510
In the screenshot below, you'll notice the URL is `localhost:9876/debug.html`. You can append a `grep` query parameter to this URL and set it to a string value which will be used to exclude tests which don't match. For example, if you changed the URL to `localhost:9876/debug.html?query=my test` and then refreshed the browser, you'd only see tests run which contain "my test" in the test description.
@@ -538,7 +520,7 @@ To run the tests for just your particular plugin run the following command from
538
520
539
521
```bash
540
522
yarn test:mocha
541
-
yarn test:browser --dev # remove the --dev flag to run them once and close
523
+
yarn test:karma:debug # remove the debug flag to run them once and close
Copy file name to clipboardExpand all lines: packages/kbn-plugin-generator/sao_template/template/README.md
+1-29Lines changed: 1 addition & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,32 +8,4 @@
8
8
9
9
## development
10
10
11
-
See the [kibana contributing guide](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md) for instructions setting up your development environment. Once you have completed that, use the following yarn scripts.
12
-
13
-
-`yarn kbn bootstrap`
14
-
15
-
Install dependencies and crosslink Kibana and all projects/plugins.
16
-
17
-
> ***IMPORTANT:*** Use this script instead of `yarn` to install dependencies when switching branches, and re-run it whenever your dependencies change.
18
-
19
-
-`yarn start`
20
-
21
-
Start kibana and have it include this plugin. You can pass any arguments that you would normally send to `bin/kibana`
For more information about any of these commands run `yarn ${task} --help`. For a full list of tasks checkout the `package.json` file, or run `yarn run`.
11
+
See the [kibana contributing guide](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md) for instructions setting up your development environment.
0 commit comments