Skip to content

Commit d62143f

Browse files
committed
Update jest config and setup, add timetableControllers.test.ts
1 parent e71811e commit d62143f

File tree

8 files changed

+640
-66
lines changed

8 files changed

+640
-66
lines changed

course-matrix/backend/__tests__/timetablesController.test.ts

Lines changed: 415 additions & 0 deletions
Large diffs are not rendered by default.

course-matrix/backend/jest.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const config: Config = {
1616
],
1717
"^.+\\.(js|jsx)$": "babel-jest",
1818
},
19+
setupFilesAfterEnv: ["<rootDir>/jest.setup.ts"],
1920
};
2021

2122
export default config;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import fetch from "node-fetch";
2+
3+
// Polyfill the global fetch for Pinecone to use
4+
globalThis.fetch = fetch as unknown as WindowOrWorkerGlobalScope["fetch"];
5+
globalThis.TransformStream = require("stream/web").TransformStream;
6+
globalThis.TextEncoder = require("util").TextEncoder;
7+
globalThis.TextDecoder = require("util").TextDecoder;
8+
globalThis.ReadableStream = require("stream/web").ReadableStream;
9+
globalThis.TransformStream = require("stream/web").TransformStream;
10+
globalThis.WritableStream = require("stream/web").WritableStream;

course-matrix/backend/package-lock.json

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

0 commit comments

Comments
 (0)