Skip to content

Commit a4ab257

Browse files
authoredNov 24, 2022
chore: use standardised e2e/node/jest.setup.ts file (inrupt#2462)
Also fixes a warning on jest.config.ts about not being part of a typescript project
1 parent edd480f commit a4ab257

File tree

5 files changed

+56
-29
lines changed

5 files changed

+56
-29
lines changed
 

‎.eslintignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ resources/
22
node_modules/
33
**/docs/**
44
**/.eslintrc.js
5-
jest.*.js
5+

‎e2e/node/jest.e2e.setup.ts

-25
This file was deleted.

‎e2e/node/jest.setup.ts

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright 2022 Inrupt Inc.
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal in
6+
* the Software without restriction, including without limitation the rights to use,
7+
* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8+
* Software, and to permit persons to whom the Software is furnished to do so,
9+
* subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in
12+
* all copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15+
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16+
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17+
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19+
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20+
*/
21+
22+
import { setupEnv } from "@inrupt/internal-test-env";
23+
24+
// Fail fast on dotenv:
25+
setupEnv();

‎jest.config.ts

+22-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
/*
2+
* Copyright 2022 Inrupt Inc.
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal in
6+
* the Software without restriction, including without limitation the rights to use,
7+
* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8+
* Software, and to permit persons to whom the Software is furnished to do so,
9+
* subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in
12+
* all copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15+
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16+
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17+
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19+
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20+
*/
21+
122
import type { Config } from "jest";
223

324
type ArrayElement<MyArray> = MyArray extends Array<infer T> ? T : never;
@@ -74,7 +95,7 @@ export default {
7495
...baseConfig,
7596
displayName: "e2e-node",
7697
roots: ["<rootDir>/e2e/node"],
77-
setupFiles: ["<rootDir>/e2e/node/jest.e2e.setup.ts"],
98+
setupFiles: ["<rootDir>/e2e/node/jest.setup.ts"],
7899
slowTestThreshold: 30,
79100
},
80101
],

‎tsconfig.build.json

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
{
2-
"include": ["packages/*/src/**/*.ts", "e2e/*/**/*.ts", "./jest.setup.ts"],
2+
"include": [
3+
"packages/*/src/**/*.ts",
4+
"e2e/*/**/*.ts",
5+
"e2e/node/jest.setup.ts",
6+
"./jest.setup.ts",
7+
"./jest.config.ts"
8+
],
39
"compilerOptions": {
410
"module": "commonjs",
511
"strict": true,
@@ -15,7 +21,7 @@
1521
"lib": ["es2018", "dom"],
1622
"moduleResolution": "node",
1723
"outDir": "./dist",
18-
// This is required to transform native ESM from our dependencies using ts-jest.
24+
// This is required to transform native ESM from our dependencies using ts-jest.
1925
"allowJs": true
2026
},
2127
"exclude": ["node_modules", "dist"],

0 commit comments

Comments
 (0)
Please sign in to comment.