test: remove split between integration and unit tests, use tags instead
This commit is contained in:
parent
59f2ce6f5f
commit
33c2f9de6f
|
@ -1 +1,2 @@
|
||||||
# https://github.com/mochajs/mocha/blob/master/example/config
|
# https://github.com/mochajs/mocha/blob/master/example/config
|
||||||
|
spec: 'tests/**/*spec.js'
|
||||||
|
|
10
README.md
10
README.md
|
@ -42,6 +42,12 @@ To run migrations:
|
||||||
`node_modules/.bin/typeorm migration:run -c <connection name>`
|
`node_modules/.bin/typeorm migration:run -c <connection name>`
|
||||||
This is also pre-defined in the npm script `typeorm:migrate`.
|
This is also pre-defined in the npm script `typeorm:migrate`.
|
||||||
|
|
||||||
## Testing
|
### Testing
|
||||||
|
|
||||||
`npm run test`
|
The testing framework of choice is [Mocha](https://mochajs.org/). Call `npm run test` to run all tests. Tests are written in typescript and need to be transpiled before testing.
|
||||||
|
|
||||||
|
#### Tagging
|
||||||
|
|
||||||
|
Mocha does [not have a seperate tagging feature](https://github.com/mochajs/mocha/wiki/Tagging), but it can filter via title. Us the following tags in your test titles:
|
||||||
|
|
||||||
|
- `@slow` when the test is particularly slow
|
||||||
|
|
|
@ -13,9 +13,8 @@
|
||||||
"typeorm:migrate:library": "typeorm migration:run -c library",
|
"typeorm:migrate:library": "typeorm migration:run -c library",
|
||||||
"watch": "gulp build --watch --dev",
|
"watch": "gulp build --watch --dev",
|
||||||
"build": "gulp build",
|
"build": "gulp build",
|
||||||
"test:integration": "mocha --spec tests/integration/**/*.spec.js",
|
"test:fast": "mocha --grep @slow --invert",
|
||||||
"test:unit": "mocha --spec tests/unit/**/*.spec.js",
|
"test": "mocha",
|
||||||
"test": "mocha --spec tests/**/*.spec.js",
|
|
||||||
"lint": "npm run eslint && npm run tslint",
|
"lint": "npm run eslint && npm run tslint",
|
||||||
"eslint-check": "eslint --print-config gulpfile.js | eslint-config-prettier-check",
|
"eslint-check": "eslint --print-config gulpfile.js | eslint-config-prettier-check",
|
||||||
"eslint": "eslint .",
|
"eslint": "eslint .",
|
||||||
|
@ -26,7 +25,7 @@
|
||||||
"forge:start": "electron-forge start",
|
"forge:start": "electron-forge start",
|
||||||
"forge:make": "electron-forge --platform win32 --arch x64 make",
|
"forge:make": "electron-forge --platform win32 --arch x64 make",
|
||||||
"forge": "npm run build && npm run forge:make",
|
"forge": "npm run build && npm run forge:make",
|
||||||
"precommit": "npm run test:unit && npm run prettier:write && npm run eslint-check && npm run tslint-check && npm run lint",
|
"precommit": "npm run prettier:write && npm run eslint-check && npm run tslint-check && npm run lint && npm run test:fast",
|
||||||
"prepush": "npm run test"
|
"prepush": "npm run test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -22,7 +22,7 @@ describe('Application', function(): void {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
it('shows an initial window', function(): any {
|
it('shows an initial window @slow', function(): any {
|
||||||
return this.app.client.getWindowCount().then((count: number) => {
|
return this.app.client.getWindowCount().then((count: number) => {
|
||||||
expect(count).to.be.gte(1);
|
expect(count).to.be.gte(1);
|
||||||
});
|
});
|
|
@ -3,7 +3,7 @@ import { afterEach, beforeEach, describe, it } from 'mocha';
|
||||||
import nock from 'nock';
|
import nock from 'nock';
|
||||||
import { Response } from 'node-fetch';
|
import { Response } from 'node-fetch';
|
||||||
import sinon from 'sinon';
|
import sinon from 'sinon';
|
||||||
import { fetch } from '../../../../src/main/services/web-crawler';
|
import { fetch } from '../../../src/main/services/web-crawler';
|
||||||
|
|
||||||
describe('Web Crawler', function(): void {
|
describe('Web Crawler', function(): void {
|
||||||
this.timeout('2s');
|
this.timeout('2s');
|
Loading…
Reference in New Issue