This repository was archived by the owner on Dec 17, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 7 files changed +65
-38
lines changed
Expand file tree Collapse file tree 7 files changed +65
-38
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ /** @type {import('ts-jest').JestConfigWithTsJest } */
2+ const config = {
3+ preset : 'ts-jest/presets/default-esm' ,
4+ testEnvironment : 'node' ,
5+ roots : [ '<rootDir>/src' , '<rootDir>/test' ] ,
6+ testMatch : [ '**/__tests__/**/*.ts' , '**/?(*.)+(spec|test).ts' ] ,
7+ collectCoverageFrom : [
8+ 'src/**/*.ts' ,
9+ '!src/**/*.d.ts' ,
10+ '!src/**/__tests__/**'
11+ ] ,
12+ coverageThreshold : {
13+ global : {
14+ branches : 90 ,
15+ functions : 90 ,
16+ lines : 90 ,
17+ statements : 90
18+ }
19+ } ,
20+ transform : {
21+ '^.+\\.tsx?$' : [
22+ 'ts-jest' ,
23+ {
24+ useESM : true ,
25+ tsconfig : {
26+ module : 'ESNext' ,
27+ moduleResolution : 'NodeNext'
28+ }
29+ }
30+ ]
31+ } ,
32+ extensionsToTreatAsEsm : [ '.ts' ] ,
33+ moduleNameMapper : {
34+ '^(\\.{1,2}/.*)\\.js$' : '$1'
35+ }
36+ } ;
37+
38+ export default config ;
Original file line number Diff line number Diff line change 1- import { ContextGenerator } from '../lib/ContextGenerator' ;
1+ import { ContextGenerator } from '../lib/ContextGenerator.js ' ;
22
33export const init = async ( ) => {
44 try {
Original file line number Diff line number Diff line change 1- import { ContextLinter } from '../lib/ContextLinter' ;
1+ import { ContextLinter } from '../lib/ContextLinter.js' ;
2+
3+ interface LintIssue {
4+ message : string ;
5+ file : string ;
6+ line : number ;
7+ suggestion ?: string ;
8+ }
29
310interface LintOptions {
411 fix ?: boolean ;
@@ -14,7 +21,7 @@ export const lint = async (options: LintOptions) => {
1421 process . exit ( 0 ) ;
1522 } else {
1623 console . log ( '\nLinting issues found:' ) ;
17- results . issues . forEach ( issue => {
24+ results . issues . forEach ( ( issue : LintIssue ) => {
1825 console . log ( `\n❌ ${ issue . message } ` ) ;
1926 console . log ( ` File: ${ issue . file } ` ) ;
2027 console . log ( ` Line: ${ issue . line } ` ) ;
Original file line number Diff line number Diff line change 1- import { ContextValidator } from '../lib/ContextValidator' ;
1+ import { ContextValidator } from '../lib/ContextValidator.js ' ;
22
33export const validate = async ( ) => {
44 try {
Original file line number Diff line number Diff line change 1- import { exec } from 'child_process' ;
2- import { promisify } from 'util' ;
3- import path from 'path' ;
4- import fs from 'fs/promises' ;
5- import { fileURLToPath } from 'url' ;
6- const __filename = fileURLToPath ( import . meta. url ) ;
7- const __dirname = path . dirname ( __filename ) ;
1+ import { exec } from 'node:child_process' ;
2+ import { promisify } from 'node:util' ;
3+ import path from 'node:path' ;
4+ import fs from 'node:fs/promises' ;
85
96const execAsync = promisify ( exec ) ;
107
118console . log ( 'Running tests...' ) ;
129
13- const cliPath = path . resolve ( __dirname , '../src /index.js' ) ;
10+ const cliPath = path . resolve ( __dirname , '../dist /index.js' ) ;
1411const testDir = path . resolve ( __dirname , 'test-context' ) ;
1512
1613describe ( 'CLI' , ( ) => {
Original file line number Diff line number Diff line change 11{
22 "compilerOptions" : {
3- "target" : " ES2020 " ,
4- "module" : " ES2020 " ,
5- "moduleResolution" : " node " ,
3+ "target" : " ES2022 " ,
4+ "module" : " NodeNext " ,
5+ "moduleResolution" : " NodeNext " ,
66 "esModuleInterop" : true ,
77 "strict" : true ,
88 "skipLibCheck" : true ,
1313 "baseUrl" : " ." ,
1414 "paths" : {
1515 "@modelcontextprotocol/sdk/*" : [" node_modules/@modelcontextprotocol/sdk/dist/*" ]
16- }
16+ },
17+ "types" : [" node" , " jest" ]
1718 },
18- "include" : [" src/**/*" ],
19- "exclude" : [" node_modules" , " dist" , " test" ]
19+ "ts-node" : {
20+ "esm" : true ,
21+ "experimentalSpecifierResolution" : " node"
22+ },
23+ "include" : [" src/**/*" , " test/**/*" ],
24+ "exclude" : [" node_modules" , " dist" ]
2025}
You can’t perform that action at this time.
0 commit comments