Skip to content

Commit

Permalink
chore(tests): updated test regex, some helper scripts (webpack#809)
Browse files Browse the repository at this point in the history
ISSUES CLOSED: webpack#808

<!-- Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. -->

**What kind of change does this PR introduce?**
Updated test regex to run all tests, added some helper scripts for running tests
<!-- E.g. a bugfix, feature, refactoring, build related change, etc… -->

**Did you add tests for your changes?**
Yes

**If relevant, did you update the documentation?**
Yes

**Summary**
* Updated tests regex to run all tests
* Added helper scripts to run cli and package tests separately
<!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? -->
<!-- Try to link to an open issue for more information. -->

**Does this PR introduce a breaking change?**
No
<!-- If this PR introduces a breaking change, please describe the impact and a migration path for existing applications. -->

**Other information**
  • Loading branch information
anshumanv authored and misterdev committed Apr 23, 2019
1 parent 6fcf344 commit b76cea1
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 9 deletions.
24 changes: 24 additions & 0 deletions .github/CONTRIBUTING.md
Expand Up @@ -83,6 +83,18 @@ In case you are suggesting a new feature, we will match your idea with our curre
npm run test
```

* Run CLI tests with:

```bash
npm run test:cli
```

* Run tests of all packages:

```bash
npm run test:packages
```

* Test a single CLI test case:

```bash
Expand Down Expand Up @@ -110,6 +122,18 @@ In case you are suggesting a new feature, we will match your idea with our curre
yarn test
```

* Run CLI tests with:

```bash
yarn test:cli`
```

* Run tests of all packages:

```bash
yarn test:packages
```

* Test a single CLI test case:

```bash
Expand Down
7 changes: 6 additions & 1 deletion package.json
Expand Up @@ -40,6 +40,8 @@
"pretest": "npm run build && npm run lint && npm run tslint",
"reportCoverage": "nyc report --reporter=json && codecov -f coverage/coverage-final.json --disable=gcov",
"test": "nyc jest --maxWorkers=4 --reporters=default --reporters=jest-junit",
"test:cli": "nyc jest test/ --maxWorkers=4 --reporters=default --reporters=jest-junit",
"test:packages": "nyc jest packages/ --maxWorkers=4 --reporters=default --reporters=jest-junit",
"test:ci": "nyc jest --maxWorkers=$(nproc) --reporters=default --reporters=jest-junit",
"travis:integration": "npm run build && npm run test && npm run reportCoverage",
"travis:lint": "npm run build && npm run lint && npm run tslint",
Expand Down Expand Up @@ -76,7 +78,10 @@
"transform": {
"^.+\\.(ts)?$": "ts-jest"
},
"testRegex": "/__tests__/.*\\.(test.js|test.ts)$",
"testRegex": [
"/__tests__/.*\\.(test.js|test.ts)$",
"/test/.*\\.(test.js|test.ts)$"
],
"moduleFileExtensions": [
"ts",
"js",
Expand Down
4 changes: 2 additions & 2 deletions test/binCases/stats/single-config/single-config.test.js
Expand Up @@ -6,8 +6,8 @@ jest.setTimeout(10E6);

const { run, extractSummary } = require("../../../testUtils");

test("single-config", async done => {
const { code, stdout, stderr } = await run(__dirname);
test("single-config", done => {
const { code, stdout, stderr } = run(__dirname);

const summary = extractSummary(stdout);

Expand Down
Expand Up @@ -28,7 +28,7 @@ afterEach(() => {
}
});

test.skip("info-verbosity-off", async done => {
test.skip("info-verbosity-off", done => {
var webpackProc = runAndGetWatchProc(__dirname, [
"--entry ",
"./index.js",
Expand Down
Expand Up @@ -28,7 +28,7 @@ afterEach(() => {
}
});

test.skip("info-verbosity-verbose", async done => {
test.skip("info-verbosity-verbose", done => {
const webpackProc = runAndGetWatchProc(__dirname, [
"--entry ",
"./index.js",
Expand Down
Expand Up @@ -28,7 +28,7 @@ afterEach(() => {
}
});

test.skip("multi-config-watch-opt", async done => {
test.skip("multi-config-watch-opt", done => {
const webpackProc = runAndGetWatchProc(__dirname, [
"--entry",
"./index.js",
Expand Down
2 changes: 1 addition & 1 deletion test/binCases/watch/multi-config/multi-config.test.js
Expand Up @@ -28,7 +28,7 @@ afterEach(() => {
}
});

test.skip("multi-config", async done => {
test.skip("multi-config", done => {
const webpackProc = runAndGetWatchProc(__dirname);

// info-verbosity is set to info by default
Expand Down
Expand Up @@ -28,7 +28,7 @@ afterEach(() => {
}
});

test.skip("single-config-watch-opt", async done => {
test.skip("single-config-watch-opt", done => {
const webpackProc = runAndGetWatchProc(__dirname, [
"--entry",
"./index.js",
Expand Down
2 changes: 1 addition & 1 deletion test/binCases/watch/single-config/single-config.test.js
Expand Up @@ -28,7 +28,7 @@ afterEach(() => {
}
});

test.skip("single-config", async(done) => {
test.skip("single-config", done => {
const webpackProc = runAndGetWatchProc(__dirname, [
"--entry",
"./index.js",
Expand Down

0 comments on commit b76cea1

Please sign in to comment.