Skip to content

Commit

Permalink
Jest shouldn't run tests from dist
Browse files Browse the repository at this point in the history
  • Loading branch information
omervk committed Feb 18, 2024
1 parent a310baf commit 9da7b8d
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 19 deletions.
7 changes: 4 additions & 3 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
};
preset: 'ts-jest',
testEnvironment: 'node',
testPathIgnorePatterns: ['/node_modules/', '/dist/'],
}
5 changes: 0 additions & 5 deletions packages/design/jest.config.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/design/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"scripts": {
"compile": "tsc-silent --project tsconfig.json --suppress 1344@src/diagram/parser.js --compiler ../../node_modules/typescript/lib/typescript.js",
"test": "jest",
"test": "jest --config=../../jest.config.js",
"generate": "jison src/diagram/stateDiagram.jison --outfile src/diagram/parser.js --module-type commonjs",
"lint": "eslint **/*.ts --fix"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/interfaces/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Interfaces between the different modules of Gamgee",
"devDependencies": {},
"scripts": {
"test": "jest",
"test": "jest --config=../../jest.config.js",
"lint": "eslint **/*.ts --fix"
},
"author": "Omer van Kloeten",
Expand Down
1 change: 0 additions & 1 deletion packages/interfaces/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { WorkflowTask } from './task'
export enum FetchStrategy {
Newest = 'LIFO',
Oldest = 'FIFO',
Drain = 'Drain', // Pick up everything except for first tasks. TODO: How should this be implemented this time?
}

export type Query = Partial<{ workflowType: string; taskName: string; strategy: FetchStrategy }>
Expand Down
5 changes: 0 additions & 5 deletions packages/run/jest.config.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/run/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"scripts": {
"generate": "mm2ws test/**/*.mermaid",
"compile": "tsc --build .",
"test": "jest",
"test": "jest --config=../../jest.config.js",
"lint": "eslint **/*.ts --fix"
},
"author": "Omer van Kloeten",
Expand Down
10 changes: 9 additions & 1 deletion packages/run/src/workflow-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@ class WorkflowFactory {
}

create(workflowType: string) {
return this.workflows[workflowType]()
const workflowCreator = this.workflows[workflowType]

if (!workflowCreator) {
throw new Error(
`Unable to initialize workflow of type ${workflowType}. Please check that it was registered by the generated code.`,
)
}

return workflowCreator()
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"scripts": {
"compile": "tsc --build .",
"test": "jest",
"test": "jest --config=../../jest.config.js",
"lint": "eslint **/*.ts --fix"
},
"author": "Omer van Kloeten",
Expand Down

0 comments on commit 9da7b8d

Please sign in to comment.