Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Hargne committed Jul 16, 2022
2 parents 4b5ac4b + 9fc367b commit 71e5c3b
Show file tree
Hide file tree
Showing 4 changed files with 2,508 additions and 3,339 deletions.
19 changes: 10 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,34 +40,35 @@
"@babel/core": "^7.9.0",
"@babel/preset-env": "^7.8.7",
"@babel/preset-typescript": "^7.8.3",
"@jest/console": "^25.1.0",
"@jest/test-result": "^25.1.0",
"@jest/types": "^26.0.23",
"@jest/console": "^28.1.0",
"@jest/test-result": "^28.1.0",
"@jest/types": "^28.1.0",
"dateformat": "3.0.2",
"mkdirp": "^1.0.3",
"sinon": "^9.0.1",
"strip-ansi": "6.0.1",
"xmlbuilder": "15.0.0"
},
"peerDependencies": {
"jest": "19.x - 27.x"
"jest": "19.x - 28.x",
"typescript": "^3.7.x || ^4.3.x"
},
"devDependencies": {
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-node-resolve": "^7.1.1",
"@types/dateformat": "^3.0.X",
"@types/jest": "27.4.0",
"@types/jest": "28.1.0",
"@types/mkdirp": "1.0.2",
"@types/node": "12.20.12",
"@types/sinon": "9.0.11",
"babel-jest": "^27.0.1",
"jest": "^27.0.1",
"babel-jest": "^28.1.0",
"jest": "^28.1.0",
"rollup": "2.47.0",
"rollup-plugin-terser": "7.0.2",
"ts-jest": "^27.0.1",
"ts-jest": "^28.0.4",
"tslint": "^5.12.0",
"tslint-config-prettier": "^1.18.0",
"typescript": "^3.7.2"
"typescript": "^4.3.x"
},
"browserslist": [
"since 2017-06"
Expand Down
4 changes: 2 additions & 2 deletions src/htmlreporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -703,8 +703,8 @@ class HTMLReporter {
* @param filePath
*/
public replaceRootDirInPath(
rootDir: Config.Path,
filePath: Config.Path
rootDir: Config.GlobalConfig['rootDir'],
filePath: Config.GlobalConfig['testPathPattern']
): string {
if (!/^<rootDir>/.test(filePath)) {
return filePath;
Expand Down
30 changes: 24 additions & 6 deletions test/mockdata/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ export const mockedJestResponseSingleTestResult: AggregatedResult = {
perfStats: {
start: 1498476492,
end: 1498476650,
runtime: 158,
slow: false
},
snapshot: {
added: 0,
Expand All @@ -68,7 +70,6 @@ export const mockedJestResponseSingleTestResult: AggregatedResult = {
skipped: false,
displayName: undefined,
leaks: false,
sourceMaps: undefined,
coverage: undefined,
openHandles: [],
testResults: [
Expand All @@ -77,6 +78,7 @@ export const mockedJestResponseSingleTestResult: AggregatedResult = {
status: "passed",
ancestorTitles: ["ancestor"],
failureMessages: [],
failureDetails: [],
numPassingAsserts: 0,
fullName: undefined,
location: null,
Expand All @@ -87,6 +89,7 @@ export const mockedJestResponseSingleTestResult: AggregatedResult = {
status: "failed",
ancestorTitles: ["ancestor"],
failureMessages: [],
failureDetails: [],
numPassingAsserts: 0,
fullName: undefined,
location: null,
Expand All @@ -97,6 +100,7 @@ export const mockedJestResponseSingleTestResult: AggregatedResult = {
status: "pending",
ancestorTitles: ["ancestor"],
failureMessages: ["failure"],
failureDetails: ["detailed failure"],
numPassingAsserts: 0,
fullName: undefined,
location: null,
Expand Down Expand Up @@ -129,7 +133,6 @@ export const mockedJestResponseMultipleTestResult: AggregatedResult = {
skipped: false,
displayName: undefined,
leaks: false,
sourceMaps: undefined,
coverage: undefined,
openHandles: [],
testResults: [
Expand All @@ -138,6 +141,7 @@ export const mockedJestResponseMultipleTestResult: AggregatedResult = {
status: "passed",
ancestorTitles: ["ancestor b"],
failureMessages: [],
failureDetails: [],
numPassingAsserts: 0,
fullName: undefined,
location: null,
Expand All @@ -148,6 +152,7 @@ export const mockedJestResponseMultipleTestResult: AggregatedResult = {
status: "passed",
ancestorTitles: ["ancestor c"],
failureMessages: [],
failureDetails: [],
numPassingAsserts: 0,
fullName: undefined,
location: null,
Expand All @@ -158,6 +163,7 @@ export const mockedJestResponseMultipleTestResult: AggregatedResult = {
status: "passed",
ancestorTitles: ["ancestor a"],
failureMessages: [],
failureDetails: [],
numPassingAsserts: 0,
fullName: undefined,
location: null,
Expand All @@ -167,6 +173,8 @@ export const mockedJestResponseMultipleTestResult: AggregatedResult = {
perfStats: {
start: 1498476492,
end: 1498476640,
runtime: 148,
slow: false
},
testFilePath: "index-a.js",
},
Expand All @@ -189,7 +197,6 @@ export const mockedJestResponseMultipleTestResult: AggregatedResult = {
skipped: false,
displayName: undefined,
leaks: false,
sourceMaps: undefined,
coverage: undefined,
openHandles: [],
testResults: [
Expand All @@ -198,6 +205,7 @@ export const mockedJestResponseMultipleTestResult: AggregatedResult = {
status: "pending",
ancestorTitles: ["ancestor b"],
failureMessages: [],
failureDetails: [],
numPassingAsserts: 0,
fullName: undefined,
location: null,
Expand All @@ -208,6 +216,7 @@ export const mockedJestResponseMultipleTestResult: AggregatedResult = {
status: "failed",
ancestorTitles: ["ancestor c", "ancestor child"],
failureMessages: ["failure"],
failureDetails: ["detailed failure"],
numPassingAsserts: 0,
fullName: undefined,
location: null,
Expand All @@ -218,6 +227,7 @@ export const mockedJestResponseMultipleTestResult: AggregatedResult = {
status: "passed",
ancestorTitles: ["ancestor a"],
failureMessages: [],
failureDetails: [],
numPassingAsserts: 0,
fullName: undefined,
location: null,
Expand All @@ -227,6 +237,8 @@ export const mockedJestResponseMultipleTestResult: AggregatedResult = {
perfStats: {
start: 1498476492,
end: 1498476639,
runtime: 147,
slow: false
},
testFilePath: "index-b.js",
},
Expand All @@ -249,7 +261,6 @@ export const mockedJestResponseMultipleTestResult: AggregatedResult = {
skipped: false,
displayName: undefined,
leaks: false,
sourceMaps: undefined,
coverage: undefined,
openHandles: [],
testResults: [
Expand All @@ -258,6 +269,7 @@ export const mockedJestResponseMultipleTestResult: AggregatedResult = {
status: "pending",
ancestorTitles: ["ancestor a"],
failureMessages: [],
failureDetails: [],
numPassingAsserts: 0,
fullName: undefined,
location: null,
Expand All @@ -268,6 +280,7 @@ export const mockedJestResponseMultipleTestResult: AggregatedResult = {
status: "failed",
ancestorTitles: ["ancestor c"],
failureMessages: ["failure"],
failureDetails: ["detailed failure"],
numPassingAsserts: 0,
fullName: undefined,
location: null,
Expand All @@ -278,6 +291,7 @@ export const mockedJestResponseMultipleTestResult: AggregatedResult = {
status: "passed",
ancestorTitles: ["ancestor b"],
failureMessages: [],
failureDetails: [],
numPassingAsserts: 0,
fullName: undefined,
location: null,
Expand All @@ -287,6 +301,8 @@ export const mockedJestResponseMultipleTestResult: AggregatedResult = {
perfStats: {
start: 1498476492,
end: 1498476650,
runtime: 158,
slow: false
},
testFilePath: "index-c.js",
},
Expand All @@ -310,13 +326,14 @@ export const mockedJestResponseMultipleTestResult: AggregatedResult = {
skipped: false,
displayName: undefined,
leaks: false,
sourceMaps: undefined,
coverage: undefined,
openHandles: [],
testResults: [],
perfStats: {
start: 0,
end: 0,
runtime: 0,
slow: false
},
testFilePath: "index-d.js",
},
Expand All @@ -328,6 +345,8 @@ export const mockedSingleTestResultReportHTML = `<div id="jesthtml-content"><hea

export const mockedJestGlobalConfig: Config.GlobalConfig = {
bail: 0,
ci: false,
snapshotFormat: {},
changedFilesWithAncestor: false,
changedSince: undefined,
coverageProvider: "v8",
Expand All @@ -341,7 +360,6 @@ export const mockedJestGlobalConfig: Config.GlobalConfig = {
},
detectLeaks: false,
detectOpenHandles: false,
enabledTestsMap: undefined,
errorOnDeprecated: false,
expand: false,
filter: null,
Expand Down
Loading

0 comments on commit 71e5c3b

Please sign in to comment.