-
Notifications
You must be signed in to change notification settings - Fork 535
/
Copy pathjest.config.cjs
41 lines (38 loc) · 1.07 KB
/
jest.config.cjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*!
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
* Licensed under the MIT License.
*/
// Get the test port from the global map and set it in env for this test
const testTools = require("@fluidframework/test-tools");
const { name } = require("./package.json");
const mappedPort = testTools.getTestPort(name);
process.env["PORT"] = mappedPort;
module.exports = {
preset: "jest-puppeteer",
globals: {
PATH: `http://localhost:${mappedPort}`,
},
testMatch: ["**/e2e-tests/?(*.)+(spec|test).[t]s"],
testPathIgnorePatterns: ["/node_modules/", "dist", "lib"],
transform: {
"^.+\\.test.ts?$": [
"ts-jest",
{
tsconfig: "e2e-tests/tsconfig.json",
},
],
},
// While we still have transitive dependencies on 'uuid<9.0.0', force the CJS entry point:
// See: https://stackoverflow.com/questions/73203367/jest-syntaxerror-unexpected-token-export-with-uuid-library
moduleNameMapper: { "^uuid$": "uuid" },
reporters: [
"default",
[
"jest-junit",
{
outputDirectory: "nyc",
outputName: "jest-junit-report.xml",
},
],
],
};