Skip to content

Commit 544bd56

Browse files
authored
chore: add retry for e2e tests to improve dx (#520)
1 parent b964d05 commit 544bd56

18 files changed

+1718
-1255
lines changed

package.json

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
"build": "cross-env rimraf lib && cross-env tsc --version && cross-env tsc",
3535
"lint": "cross-env eslint ./src ./test --ext .ts",
3636
"test": "yarn build && yarn test:unit && yarn test:e2e",
37-
"test:unit": "cross-env jest unit",
38-
"test:e2e": "npm pack && cross-env jest e2e --ci --runInBand --bail --verbose",
37+
"test:unit": "cross-env jest --config=test/unit/jest.config.js",
38+
"test:e2e": "npm pack && cross-env jest --config=test/e2e/jest.config.js --ci -i -b",
3939
"precommit": "cross-env lint-staged && yarn build && yarn test:unit",
4040
"commit": "cross-env git-cz",
4141
"semantic-release": "semantic-release"
@@ -73,43 +73,45 @@
7373
"tapable": "^1.0.0"
7474
},
7575
"devDependencies": {
76-
"@commitlint/config-conventional": "^8.3.4",
76+
"@commitlint/config-conventional": "^11.0.0",
7777
"@semantic-release/commit-analyzer": "^8.0.1",
7878
"@semantic-release/exec": "^5.0.0",
79-
"@semantic-release/github": "^7.0.7",
80-
"@semantic-release/npm": "^7.0.5",
79+
"@semantic-release/github": "^7.1.1",
80+
"@semantic-release/npm": "^7.0.6",
8181
"@semantic-release/release-notes-generator": "^9.0.1",
82-
"@types/babel__code-frame": "^7.0.1",
82+
"@types/babel__code-frame": "^7.0.2",
8383
"@types/cross-spawn": "^6.0.2",
84-
"@types/eslint": "^6.8.0",
85-
"@types/fs-extra": "^8.1.0",
86-
"@types/jest": "^25.2.1",
84+
"@types/eslint": "^7.2.4",
85+
"@types/fs-extra": "^9.0.2",
86+
"@types/jest": "^26.0.14",
8787
"@types/minimatch": "^3.0.1",
88-
"@types/mock-fs": "^4.10.0",
89-
"@types/node": "^13.11.1",
88+
"@types/mock-fs": "^4.13.0",
89+
"@types/node": "^14.11.10",
9090
"@types/rimraf": "^3.0.0",
91-
"@types/semver": "^7.1.0",
92-
"@types/webpack": "^4.41.11",
91+
"@types/semver": "^7.3.4",
92+
"@types/webpack": "^4.41.22",
9393
"@typescript-eslint/eslint-plugin": "^2.27.0",
9494
"@typescript-eslint/parser": "^2.27.0",
95-
"commitlint": "^8.3.5",
95+
"commitlint": "^11.0.0",
9696
"cross-env": "^7.0.2",
97-
"cross-spawn": "^7.0.2",
97+
"cross-spawn": "^7.0.3",
9898
"eslint": "^6.8.0",
99-
"eslint-config-prettier": "^6.10.1",
99+
"eslint-config-prettier": "^6.13.0",
100100
"eslint-plugin-node": "^11.1.0",
101-
"eslint-plugin-prettier": "^3.1.3",
102-
"git-cz": "^4.3.1",
103-
"husky": "^4.2.5",
104-
"jest": "^25.3.0",
105-
"lint-staged": "^10.1.3",
106-
"mock-fs": "^4.11.0",
107-
"prettier": "^2.0.4",
101+
"eslint-plugin-prettier": "^3.1.4",
102+
"git-cz": "^4.7.1",
103+
"husky": "^4.3.0",
104+
"jest": "^26.5.3",
105+
"jest-circus": "^26.5.3",
106+
"jest-environment-node": "^26.5.2",
107+
"lint-staged": "^10.4.2",
108+
"mock-fs": "^4.13.0",
109+
"prettier": "^2.1.2",
108110
"rimraf": "^3.0.2",
109-
"semantic-release": "^17.0.0",
111+
"semantic-release": "^17.2.1",
110112
"strip-ansi": "^6.0.0",
111113
"tree-kill": "^1.2.2",
112-
"ts-jest": "^25.3.1",
114+
"ts-jest": "^26.4.1",
113115
"typescript": "^3.8.3",
114116
"webpack": "^4.42.1"
115117
},

src/typescript-reporter/TypeScriptReporterConfiguration.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import webpack from 'webpack';
22
import path from 'path';
3-
import * as ts from 'typescript';
43
import semver from 'semver';
54
import { TypeScriptDiagnosticsOptions } from './TypeScriptDiagnosticsOptions';
65
import { TypeScriptReporterOptions } from './TypeScriptReporterOptions';

src/typescript-reporter/file-system/RealFileSystem.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ function createRealFileSystem(caseSensitive = false): FileSystem {
5151
const stats = readStats(normalizedPath);
5252

5353
if (stats && stats.isFile()) {
54-
readFileCache.set(normalizedPath, fs.readFileSync(normalizedPath, { encoding }).toString());
54+
readFileCache.set(
55+
normalizedPath,
56+
fs.readFileSync(normalizedPath, { encoding: encoding as BufferEncoding }).toString()
57+
);
5558
} else {
5659
readFileCache.set(normalizedPath, undefined);
5760
}

test/e2e/EsLint.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ describe('EsLint', () => {
2525
it.each([
2626
{ async: false, webpack: '4.0.0', absolute: false },
2727
{ async: true, webpack: '^4.0.0', absolute: true },
28-
{ async: false, webpack: '^5.0.0-beta.16', absolute: true },
29-
{ async: true, webpack: '^5.0.0-beta.16', absolute: false },
28+
{ async: false, webpack: '^5.0.0', absolute: true },
29+
{ async: true, webpack: '^5.0.0', absolute: false },
3030
])('reports lint error for %p', async ({ async, webpack, absolute }) => {
3131
await sandbox.load([
3232
await readFixture(join(__dirname, 'fixtures/environment/eslint-basic.fixture'), {

test/e2e/OutOfMemoryAndCosmiconfig.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ describe('ForkTsCheckerWebpackPlugin Out Of Memory and Cosmiconfig', () => {
2121
it.each([
2222
{ async: false, webpack: '4.0.0' },
2323
{ async: true, webpack: '^4.0.0' },
24-
{ async: false, webpack: '^5.0.0-beta.16' },
25-
{ async: true, webpack: '^5.0.0-beta.16' },
24+
{ async: false, webpack: '^5.0.0' },
25+
{ async: true, webpack: '^5.0.0' },
2626
])('handles out of memory for %p', async ({ async, webpack }) => {
2727
await sandbox.load([
2828
await readFixture(join(__dirname, 'fixtures/environment/typescript-basic.fixture'), {

test/e2e/TypeScriptConfigurationChange.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ describe('TypeScript Configuration Change', () => {
2525
it.each([
2626
{ async: true, webpack: '~4.0.0', typescript: '2.7.1', tsloader: '^5.0.0' },
2727
{ async: false, webpack: '^4.0.0', typescript: '~3.0.0', tsloader: '^6.0.0' },
28-
{ async: true, webpack: '^5.0.0-beta.16', typescript: '~3.7.0', tsloader: '^7.0.0' },
29-
{ async: false, webpack: '^5.0.0-beta.16', typescript: '~3.8.0', tsloader: '^6.0.0' },
28+
{ async: true, webpack: '^5.0.0', typescript: '~3.7.0', tsloader: '^7.0.0' },
29+
{ async: false, webpack: '^5.0.0', typescript: '~3.8.0', tsloader: '^6.0.0' },
3030
])(
3131
'change in the tsconfig.json affects compilation for %p',
3232
async ({ async, webpack, typescript, tsloader }) => {

test/e2e/TypeScriptWatchApi.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ describe('TypeScript Watch API', () => {
2525
it.each([
2626
{ async: false, webpack: '4.0.0' },
2727
{ async: true, webpack: '^4.0.0' },
28-
{ async: false, webpack: '^5.0.0-beta.16' },
29-
{ async: true, webpack: '^5.0.0-beta.16' },
28+
{ async: false, webpack: '^5.0.0' },
29+
{ async: true, webpack: '^5.0.0' },
3030
])(
3131
'reports semantic error for %p with importsNotUsedAsValues configuration with ts-loader',
3232
async ({ async, webpack }) => {
@@ -152,8 +152,8 @@ describe('TypeScript Watch API', () => {
152152
it.each([
153153
{ async: false, webpack: '4.0.0' },
154154
{ async: true, webpack: '^4.0.0' },
155-
{ async: false, webpack: '^5.0.0-beta.16' },
156-
{ async: true, webpack: '^5.0.0-beta.16' },
155+
{ async: false, webpack: '^5.0.0' },
156+
{ async: true, webpack: '^5.0.0' },
157157
])(
158158
'reports semantic error for %p with onlyRemoveTypeImports configuration with babel-loader',
159159
async ({ async, webpack }) => {

test/e2e/WebpackIssueScope.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ describe('Webpack Issue Scope', () => {
2727
{ webpack: '4.0.0', async: false, scope: 'all' },
2828
{ webpack: '^4.0.0', async: false, scope: 'webpack' },
2929
{ webpack: '^4.0.0', async: true, scope: 'all' },
30-
{ webpack: '^5.0.0-beta.16', async: true, scope: 'webpack' },
31-
{ webpack: '^5.0.0-beta.16', async: false, scope: 'all' },
30+
{ webpack: '^5.0.0', async: true, scope: 'webpack' },
31+
{ webpack: '^5.0.0', async: false, scope: 'all' },
3232
])(
3333
'reports errors only related to the given scope with %p',
3434
async ({ webpack, async, scope }) => {

test/e2e/WebpackNodeApi.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe('Webpack Node Api', () => {
1818
await sandbox.cleanup();
1919
});
2020

21-
it.each([{ webpack: '4.0.0' }, { webpack: '^4.0.0' }, { webpack: '^5.0.0-beta.16' }])(
21+
it.each([{ webpack: '4.0.0' }, { webpack: '^4.0.0' }, { webpack: '^5.0.0' }])(
2222
'compiles the project successfully with %p',
2323
async ({ webpack }) => {
2424
await sandbox.load([

test/e2e/WebpackProductionBuild.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe('Webpack Production Build', () => {
2020
await sandbox.cleanup();
2121
});
2222

23-
it.each([{ webpack: '4.0.0' }, { webpack: '^4.0.0' }, { webpack: '^5.0.0-beta.16' }])(
23+
it.each([{ webpack: '4.0.0' }, { webpack: '^4.0.0' }, { webpack: '^5.0.0' }])(
2424
'compiles the project successfully with %p',
2525
async ({ webpack }) => {
2626
await sandbox.load([
@@ -65,7 +65,7 @@ describe('Webpack Production Build', () => {
6565
}
6666
);
6767

68-
it.each([{ webpack: '4.0.0' }, { webpack: '^4.0.0' }, { webpack: '^5.0.0-beta.16' }])(
68+
it.each([{ webpack: '4.0.0' }, { webpack: '^4.0.0' }, { webpack: '^5.0.0' }])(
6969
'exits with error on the project error with %p',
7070
async ({ webpack }) => {
7171
await sandbox.load([

0 commit comments

Comments
 (0)