Skip to content

Commit e954ca3

Browse files
Fix test
Co-authored-by: SrinivasanTarget <[email protected]>
1 parent 6e3beb7 commit e954ca3

File tree

4 files changed

+20
-8
lines changed

4 files changed

+20
-8
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,20 @@ jobs:
1818
- name: Setup Node.js
1919
uses: actions/setup-node@v4
2020
with:
21-
node-version: '18'
21+
node-version: '22'
2222
cache: 'npm'
2323

2424
- name: Install dependencies
25-
run: npm ci
25+
run: npm install
26+
27+
- name: List installed packages
28+
run: npm list --depth=0
2629

2730
- name: Run ESLint
2831
run: npm run lint
2932

3033
- name: Run Prettier check
3134
run: npm run format:check
32-
35+
3336
- name: Run Locator Tests
3437
run: npm run test:locators

jest.config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export default {
2-
preset: 'ts-jest',
2+
preset: 'ts-jest/presets/js-with-ts-esm',
33
testEnvironment: 'node',
44
extensionsToTreatAsEsm: ['.ts'],
55
moduleNameMapper: {
@@ -13,4 +13,8 @@ export default {
1313
},
1414
],
1515
},
16+
// Add this to ensure Jest can handle ESM
17+
transformIgnorePatterns: [
18+
'node_modules/(?!(@xmldom|fast-xml-parser|xpath)/)'
19+
],
1620
};

package-lock.json

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
"start:sse:port": "node src/index.js --sse --port=",
1515
"dev": "npx fastmcp dev src/index.js",
1616
"inspect": "npx fastmcp inspect src/index.js",
17-
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
18-
"test:locators": "node --experimental-vm-modules node_modules/jest/bin/jest.js src/tests/generate-all-locators.test.ts",
17+
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
18+
"test:locators": "NODE_OPTIONS=--experimental-vm-modules jest src/tests/generate-all-locators.test.ts",
1919
"lint": "eslint src --ext .ts",
2020
"lint:fix": "eslint src --ext .ts --fix",
2121
"format": "prettier --write \"src/**/*.{ts,js,json}\"",
@@ -38,14 +38,18 @@
3838
"zod": "^3.24.3"
3939
},
4040
"devDependencies": {
41+
"@jest/globals": "^29.7.0",
42+
"@types/jest": "^29.5.12",
4143
"@types/lodash": "^4.17.17",
4244
"@types/node": "^22.15.18",
4345
"@typescript-eslint/eslint-plugin": "^8.34.0",
4446
"@typescript-eslint/parser": "^8.34.0",
4547
"eslint": "^9.28.0",
4648
"eslint-config-prettier": "^10.1.5",
4749
"eslint-plugin-prettier": "^5.4.1",
50+
"jest": "^29.7.0",
4851
"prettier": "^3.5.3",
52+
"ts-jest": "^29.1.2",
4953
"typescript": "^5.8.3"
5054
}
5155
}

0 commit comments

Comments
 (0)