Skip to content

Commit

Permalink
Merge pull request #97 from guardian/pf/jest-setup-for-pollers
Browse files Browse the repository at this point in the history
Jest setup for `poller-lambdas` project
  • Loading branch information
bryophyta authored Jan 13, 2025
2 parents 93e01d9 + 1e126eb commit 0acedf6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
9 changes: 7 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ const generateProject = (name) => {
return {
displayName: name,
transform: {
'^.+\\.tsx?$': 'ts-jest',
'^.+\\.tsx?$': [
'ts-jest',
{
isolatedModules: true,
},
],
},
testMatch: [`<rootDir>/${name}/**/*.test.ts`],
setupFilesAfterEnv: [`./${name}/jest.setup.js`],
Expand All @@ -12,5 +17,5 @@ const generateProject = (name) => {
module.exports = {
verbose: true,
testEnvironment: 'node',
projects: ['cdk', 'ingestion-lambda'].map(generateProject),
projects: ['cdk', 'ingestion-lambda', 'poller-lambdas'].map(generateProject),
};
Empty file added poller-lambdas/jest.setup.js
Empty file.
3 changes: 2 additions & 1 deletion poller-lambdas/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"typecheck": "tsc -noEmit",
"build": "esbuild src/index.ts --bundle --minify --outfile=dist/index.js --external:@aws-sdk --external:aws-sdk --platform=node",
"lint": "eslint src/** --ext .ts --no-error-on-unmatched-pattern --fix",
"lint:ci": "eslint src/** --ext .ts --no-error-on-unmatched-pattern"
"lint:ci": "eslint src/** --ext .ts --no-error-on-unmatched-pattern",
"test": "jest --detectOpenHandles --config ../jest.config.js --selectProjects poller-lambdas"
},
"dependencies": {},
"devDependencies": {
Expand Down
5 changes: 5 additions & 0 deletions poller-lambdas/src/test.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
describe('test', () => {
it('should pass', () => {
expect(true).toBe(true);
});
});

0 comments on commit 0acedf6

Please sign in to comment.