Merge pull request #7505 from electron/testing-docs
Update test dependencies and documentation
This commit is contained in:
commit
c46c1dbb1e
6 changed files with 67 additions and 54 deletions
|
@ -121,17 +121,7 @@ $ sudo ln -s /usr/lib/libncurses.so.5 /usr/lib/libtinfo.so.5
|
|||
|
||||
## Tests
|
||||
|
||||
Test your changes conform to the project coding style using:
|
||||
|
||||
```bash
|
||||
$ npm run lint
|
||||
```
|
||||
|
||||
Test functionality using:
|
||||
|
||||
```bash
|
||||
$ ./script/test.py
|
||||
```
|
||||
See [Build System Overview: Tests](build-system-overview.md#tests)
|
||||
|
||||
## Advanced topics
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ the following Python modules:
|
|||
## Getting the Code
|
||||
|
||||
```bash
|
||||
$ git clone https://github.com/electron/electron.git
|
||||
$ git clone https://github.com/electron/electron
|
||||
```
|
||||
|
||||
## Bootstrapping
|
||||
|
@ -61,14 +61,4 @@ $ npm run clean
|
|||
|
||||
## Tests
|
||||
|
||||
Test your changes conform to the project coding style using:
|
||||
|
||||
```bash
|
||||
$ ./script/cpplint.py
|
||||
```
|
||||
|
||||
Test functionality using:
|
||||
|
||||
```bash
|
||||
$ ./script/test.py
|
||||
```
|
||||
See [Build System Overview: Tests](build-system-overview.md#tests)
|
||||
|
|
|
@ -87,27 +87,7 @@ $ npm run clean
|
|||
|
||||
## Tests
|
||||
|
||||
Test your changes conform to the project coding style using:
|
||||
|
||||
```powershell
|
||||
$ python script\cpplint.py
|
||||
```
|
||||
|
||||
Test functionality using:
|
||||
|
||||
```powershell
|
||||
$ python script\test.py
|
||||
```
|
||||
|
||||
Tests that include native modules (e.g. `runas`) can't be executed with the
|
||||
debug build (see [#2558](https://github.com/electron/electron/issues/2558) for
|
||||
details), but they will work with the release build.
|
||||
|
||||
To run the tests with the release build use:
|
||||
|
||||
```powershell
|
||||
$ python script\test.py -R
|
||||
```
|
||||
See [Build System Overview: Tests](build-system-overview.md#tests)
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
|
|
|
@ -71,3 +71,52 @@ to generate one target at a time as stated above.
|
|||
|
||||
This only affects developers, if you are just building Electron for rebranding
|
||||
you are not affected.
|
||||
|
||||
## Tests
|
||||
|
||||
Test your changes conform to the project coding style using:
|
||||
|
||||
```bash
|
||||
$ npm run lint
|
||||
```
|
||||
|
||||
Test functionality using:
|
||||
|
||||
```bash
|
||||
$ npm test
|
||||
```
|
||||
|
||||
Whenever you make changes to Electron source code, you'll need to re-run the
|
||||
build before the tests:
|
||||
|
||||
```bash
|
||||
$ npm run build && npm test
|
||||
```
|
||||
|
||||
You can make the test suite run faster by isolating the specific test or block
|
||||
you're currently working on using Mocha's
|
||||
[exclusive tests](https://mochajs.org/#exclusive-tests) feature. Just append
|
||||
`.only` to any `describe` or `it` function call:
|
||||
|
||||
```js
|
||||
describe.only('some feature', function () {
|
||||
// ... only tests in this block will be run
|
||||
})
|
||||
```
|
||||
|
||||
Alternatively, you can use mocha's `grep` option to only run tests matching the
|
||||
given regular expression pattern:
|
||||
|
||||
```sh
|
||||
$ npm test -- --grep child_process
|
||||
```
|
||||
|
||||
Tests that include native modules (e.g. `runas`) can't be executed with the
|
||||
debug build (see [#2558](https://github.com/electron/electron/issues/2558) for
|
||||
details), but they will work with the release build.
|
||||
|
||||
To run the tests with the release build use:
|
||||
|
||||
```bash
|
||||
$ npm test -- -R
|
||||
```
|
||||
|
|
|
@ -278,6 +278,10 @@ describe('app module', function () {
|
|||
const shouldFail = process.platform === 'win32' ||
|
||||
(process.platform === 'linux' && !app.isUnityRunning())
|
||||
|
||||
afterEach(function () {
|
||||
app.setBadgeCount(0)
|
||||
})
|
||||
|
||||
it('returns false when failed', function () {
|
||||
assert.equal(app.setBadgeCount(42), !shouldFail)
|
||||
})
|
||||
|
|
|
@ -4,16 +4,16 @@
|
|||
"main": "static/main.js",
|
||||
"version": "0.1.0",
|
||||
"devDependencies": {
|
||||
"basic-auth": "^1.0.0",
|
||||
"graceful-fs": "3.0.5",
|
||||
"mocha": "2.1.0",
|
||||
"mkdirp": "0.5.1",
|
||||
"multiparty": "4.1.2",
|
||||
"q": "0.9.7",
|
||||
"temp": "0.8.1",
|
||||
"walkdir": "0.0.7",
|
||||
"ws": "0.7.2",
|
||||
"yargs": "^4.7.1"
|
||||
"basic-auth": "^1.0.4",
|
||||
"graceful-fs": "^4.1.9",
|
||||
"mkdirp": "^0.5.1",
|
||||
"mocha": "^3.1.0",
|
||||
"multiparty": "^4.1.2",
|
||||
"q": "^1.4.1",
|
||||
"temp": "^0.8.3",
|
||||
"walkdir": "0.0.11",
|
||||
"ws": "^1.1.1",
|
||||
"yargs": "^6.0.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"ffi": "2.0.0",
|
||||
|
|
Loading…
Reference in a new issue