Skip to content

Commit 9da7b8d

Browse files
committed
Jest shouldn't run tests from dist
1 parent a310baf commit 9da7b8d

File tree

9 files changed

+17
-19
lines changed

9 files changed

+17
-19
lines changed

jest.config.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/** @type {import('ts-jest').JestConfigWithTsJest} */
22
module.exports = {
3-
preset: 'ts-jest',
4-
testEnvironment: 'node',
5-
};
3+
preset: 'ts-jest',
4+
testEnvironment: 'node',
5+
testPathIgnorePatterns: ['/node_modules/', '/dist/'],
6+
}

packages/design/jest.config.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

packages/design/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
},
2424
"scripts": {
2525
"compile": "tsc-silent --project tsconfig.json --suppress 1344@src/diagram/parser.js --compiler ../../node_modules/typescript/lib/typescript.js",
26-
"test": "jest",
26+
"test": "jest --config=../../jest.config.js",
2727
"generate": "jison src/diagram/stateDiagram.jison --outfile src/diagram/parser.js --module-type commonjs",
2828
"lint": "eslint **/*.ts --fix"
2929
},

packages/interfaces/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Interfaces between the different modules of Gamgee",
55
"devDependencies": {},
66
"scripts": {
7-
"test": "jest",
7+
"test": "jest --config=../../jest.config.js",
88
"lint": "eslint **/*.ts --fix"
99
},
1010
"author": "Omer van Kloeten",

packages/interfaces/store.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { WorkflowTask } from './task'
33
export enum FetchStrategy {
44
Newest = 'LIFO',
55
Oldest = 'FIFO',
6-
Drain = 'Drain', // Pick up everything except for first tasks. TODO: How should this be implemented this time?
76
}
87

98
export type Query = Partial<{ workflowType: string; taskName: string; strategy: FetchStrategy }>

packages/run/jest.config.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

packages/run/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"scripts": {
1818
"generate": "mm2ws test/**/*.mermaid",
1919
"compile": "tsc --build .",
20-
"test": "jest",
20+
"test": "jest --config=../../jest.config.js",
2121
"lint": "eslint **/*.ts --fix"
2222
},
2323
"author": "Omer van Kloeten",

packages/run/src/workflow-factory.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,15 @@ class WorkflowFactory {
99
}
1010

1111
create(workflowType: string) {
12-
return this.workflows[workflowType]()
12+
const workflowCreator = this.workflows[workflowType]
13+
14+
if (!workflowCreator) {
15+
throw new Error(
16+
`Unable to initialize workflow of type ${workflowType}. Please check that it was registered by the generated code.`,
17+
)
18+
}
19+
20+
return workflowCreator()
1321
}
1422
}
1523

packages/test/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
},
1515
"scripts": {
1616
"compile": "tsc --build .",
17-
"test": "jest",
17+
"test": "jest --config=../../jest.config.js",
1818
"lint": "eslint **/*.ts --fix"
1919
},
2020
"author": "Omer van Kloeten",

0 commit comments

Comments
 (0)