Skip to content

Commit ffe5fd1

Browse files
authored
Merge pull request #513 from auth0/fix-coverage
Fix the coverage reporting
2 parents 5ef6a7b + ce47cc2 commit ffe5fd1

3 files changed

Lines changed: 29 additions & 21 deletions

File tree

package-lock.json

Lines changed: 13 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,17 +123,17 @@
123123
},
124124
"jest": {
125125
"testEnvironment": "node",
126-
"rootDir": "tests",
126+
"rootDir": ".",
127127
"moduleFileExtensions": [
128128
"ts",
129129
"tsx",
130130
"js"
131131
],
132132
"collectCoverageFrom": [
133-
"src/**/*.*",
134-
"!src/index.browser.ts",
135-
"!src/index.ts",
136-
"!src/handlers/auth.ts"
133+
"<rootDir>/src/**/*.*",
134+
"!<rootDir>/src/index.browser.ts",
135+
"!<rootDir>/src/index.ts",
136+
"!<rootDir>/src/handlers/auth.ts"
137137
],
138138
"coverageReporters": [
139139
"lcov",
@@ -149,9 +149,16 @@
149149
}
150150
},
151151
"preset": "ts-jest",
152-
"globalSetup": "./global-setup.ts",
152+
"globals": {
153+
"ts-jest": {
154+
"tsconfig": {
155+
"target": "es6"
156+
}
157+
}
158+
},
159+
"globalSetup": "./tests/global-setup.ts",
153160
"setupFilesAfterEnv": [
154-
"./setup.ts"
161+
"./tests/setup.ts"
155162
]
156163
}
157164
}

src/utils/errors.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export class AccessTokenError extends Error {
99
public code: string;
1010

1111
constructor(code: string, message: string) {
12-
super(message) /* istanbul ignore next */;
12+
super(message);
1313

1414
// Saving class name in the property of our custom error as a shortcut.
1515
this.name = this.constructor.name;
@@ -49,7 +49,7 @@ export class HandlerError extends Error {
4949
public code: string | undefined;
5050

5151
constructor(error: Error | AccessTokenError | HttpError) {
52-
super(htmlSafe(error.message)) /* istanbul ignore next */;
52+
super(htmlSafe(error.message));
5353

5454
this.name = error.name;
5555

0 commit comments

Comments
 (0)