forked from electron/electron
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Allow testing of single spec modules (electron#11409)
* 🔧 ES6 for the spec * 👷 Allow testing of single modules * ❤️ Implement feedback * 📝 Add a testing doc * 📝 Link to it * 📝 Cleanup
- Loading branch information
1 parent
a161f6e
commit 5f4b62b
Showing
4 changed files
with
101 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Testing | ||
|
||
We aim to keep the code coverage of Electron high. We ask that all pull | ||
request not only pass all existing tests, but ideally also add new tests | ||
to cover changed code and new scenarios. Ensuring that we capture as | ||
many code paths and use cases of Electron as possible ensures that we | ||
all ship apps with fewer bugs. | ||
|
||
This repository comes with linting rules for both JavaScript and C++ – | ||
as well as unit and integration tests. To learn more about Electron's | ||
coding style, please see the [coding-style(coding-style.md) document. | ||
|
||
## Linting | ||
To ensure that your JavaScript is in compliance with the Electron coding | ||
style, run `npm run lint-js`, which will run `standard` against both | ||
Electron itself as well as the unit tests. If you are using an editor | ||
with a plugin/addon system, you might want to use one of the many | ||
[StandardJS addons](standard-addons) to be informed of coding style | ||
violations before you ever commit them. | ||
|
||
To run `standard` with parameters, run `npm run lint-js --` followed by | ||
arguments you want passed to `standard`. | ||
|
||
To ensure that your C++ is in compliance with the Electron coding style, | ||
run `npm run lint-cpp`, which runs a `cpplint` script. We recommend that | ||
you use `clang-format` and prepared [a short tutorial](clang-format.md). | ||
|
||
There is not a lot of Python in this repository, but it too is governed | ||
by coding style rules. `npm run lint-py` will check all Python, using | ||
`pylint` to do so. | ||
|
||
## Unit Tests | ||
|
||
To run all unit tests, run `npm run test`. The unit tests are an Electron | ||
app (surprise!) that can be found in the `spec` folder. Note that it has | ||
its own `package.json` and that its dependencies are therefore not defined | ||
in the top-level `package.json`. | ||
|
||
To run only a selected number of tests, run `npm run test -match=NAME`, | ||
replacing the `NAME` with the file name of the test suite you would like | ||
to run. As an example: If you want to run only IPC suites, you would run | ||
`npm run test -match=ipc`. | ||
|
||
[standard-addons]: https://standardjs.com/#are-there-text-editor-plugins |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters