Skip to content

Commit

Permalink
build: fix TypeScript configuration for test files
Browse files Browse the repository at this point in the history
Co-Authored-By: Michael Latman <[email protected]>
  • Loading branch information
devin-ai-integration[bot] and michaellatman committed Dec 12, 2024
1 parent 86bb6e7 commit c2f40b6
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
8 changes: 6 additions & 2 deletions jest.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@ const config = {
},
],
},
testMatch: ['**/__tests__/**/*.test.ts'],
testPathIgnorePatterns: ['/node_modules/', '/loaders/'],
roots: ['<rootDir>/src', '<rootDir>/test'],
testMatch: [
'**/__tests__/**/*.ts',
'**/test/**/*.test.ts'
],
testPathIgnorePatterns: ['/node_modules/', '/loaders/', 'setup.ts'],
};

export default config;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "A NPX command to install and list packages",
"main": "dist/index.js",
"scripts": {
"build": "tsc && chmod +x dist/index.js",
"build": "tsc --project tsconfig.build.json && chmod +x dist/index.js",
"start": "node dist/index.js",
"test": "NODE_OPTIONS=--experimental-vm-modules jest --config jest.config.mjs",
"test:list": "node --loader ts-node/esm src/index.ts list",
Expand Down
11 changes: 11 additions & 0 deletions tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist"
},
"exclude": [
"test",
"**/__tests__/**"
]
}
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"outDir": "./dist",
"rootDir": "./src",
"rootDir": ".",
"types": ["node", "jest"]
},
"include": ["src/**/*", "test/**/*"],
Expand Down

0 comments on commit c2f40b6

Please sign in to comment.