Skip to content
This repository was archived by the owner on Nov 14, 2025. It is now read-only.

Commit e43499c

Browse files
committed
fix: update Jest configuration and fix ESM mocking in tests
1 parent 32b1075 commit e43499c

File tree

5 files changed

+12
-14
lines changed

5 files changed

+12
-14
lines changed

.husky/pre-commit

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1 @@
1-
# Run lint-staged to check formatting and linting on staged files
2-
npx lint-staged || exit 1
3-
4-
# Run type checking
5-
pnpm run check-types || exit 1
6-
7-
# Run tests
8-
pnpm run test || exit 1
1+
npm test

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ COPY package.json pnpm-lock.yaml ./
99
RUN npm install -g pnpm@10.7.0
1010

1111
# Disable Husky during Docker build
12-
ENV HUSKY=0
12+
ENV SKIP_HUSKY=1
1313
ENV NODE_ENV=production
1414

1515
# Install dependencies

jest.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,16 @@ export default {
55
testMatch: ['**/__tests__/**/*.test.ts'],
66
moduleNameMapper: {
77
'^(\\.{1,2}/.*)\\.js$': '$1',
8+
'^(\\.{1,2}/.*)\\.ts$': '$1',
89
},
910
transform: {
1011
'^.+\\.tsx?$': [
1112
'ts-jest',
1213
{
1314
useESM: true,
15+
tsconfig: {
16+
moduleResolution: "NodeNext"
17+
}
1418
},
1519
],
1620
},

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "deepsource-mcp-server",
3-
"version": "1.0.2",
3+
"version": "0.0.0",
44
"description": "Model Context Protocol server for DeepSource",
55
"type": "module",
66
"main": "dist/index.js",
@@ -16,15 +16,15 @@
1616
"start": "node --experimental-specifier-resolution=node dist/index.js",
1717
"dev": "ts-node-dev --respawn --transpile-only src/index.ts",
1818
"watch": "tsc -w",
19-
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
20-
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch",
21-
"test:coverage": "NODE_OPTIONS=--experimental-vm-modules jest --coverage",
19+
"test": "NODE_OPTIONS='--experimental-vm-modules --no-warnings' jest",
20+
"test:watch": "NODE_OPTIONS='--experimental-vm-modules --no-warnings' jest --watch",
21+
"test:coverage": "NODE_OPTIONS='--experimental-vm-modules --no-warnings' jest --coverage",
2222
"lint": "eslint . --ext .ts",
2323
"lint:fix": "eslint . --ext .ts --fix",
2424
"format": "prettier --write \"src/**/*.ts\"",
2525
"format:check": "prettier --check \"src/**/*.ts\"",
2626
"check-types": "tsc --noEmit",
27-
"prepare": "[ -n \"$HUSKY\" ] || husky",
27+
"prepare": "husky",
2828
"validate": "npm run check-types && npm run lint && npm run test"
2929
},
3030
"lint-staged": {

src/__tests__/server.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { DeepSourceClient, DeepSourceIssue } from '../deepsource';
44
import express from 'express';
55
import request from 'supertest';
66
import { SSEServerTransport } from '@modelcontextprotocol/sdk/server/sse.js';
7+
import { jest } from '@jest/globals';
78

89
// Mock DeepSource client
910
jest.mock('../deepsource');

0 commit comments

Comments
 (0)