test: Update jest configuration (#3951)
* Split shared tests * Centralize and parallelize jest config * ci
This commit is contained in:
@@ -1,17 +0,0 @@
|
||||
{
|
||||
"verbose": false,
|
||||
"rootDir": "..",
|
||||
"roots": [
|
||||
"<rootDir>/server",
|
||||
"<rootDir>/shared"
|
||||
],
|
||||
"moduleNameMapper": {
|
||||
"^@server/(.*)$": "<rootDir>/server/$1",
|
||||
"^@shared/(.*)$": "<rootDir>/shared/$1"
|
||||
},
|
||||
"setupFiles": [
|
||||
"<rootDir>/__mocks__/console.js",
|
||||
"./server/test/setup.ts"
|
||||
],
|
||||
"testEnvironment": "node"
|
||||
}
|
||||
@@ -19,9 +19,7 @@ export default class Queue {
|
||||
const job = this.createJob(data);
|
||||
|
||||
if (!this.handler) {
|
||||
throw Error(
|
||||
"Mocking version requires handler to be set before first add()"
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
this.handler(job, this.done);
|
||||
|
||||
@@ -22,6 +22,9 @@ jest.mock("bull");
|
||||
// This is needed for the relative manual mock to be picked up
|
||||
jest.mock("../queues");
|
||||
|
||||
// Avoid "Yjs was already imported" errors in the test environment
|
||||
jest.mock("yjs");
|
||||
|
||||
// We never want to make real S3 requests in test environment
|
||||
jest.mock("aws-sdk", () => {
|
||||
const mS3 = {
|
||||
|
||||
Reference in New Issue
Block a user