Skip to content

Commit 9df0b06

Browse files
authored
Merge pull request #14 from Countly/ar2rsawseen/main
eslint for tests
2 parents 24bac73 + c932b5b commit 9df0b06

File tree

7 files changed

+31
-15
lines changed

7 files changed

+31
-15
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929

3030
- name: Run TypeScript compiler check
3131
run: npm run build
32+
3233
test:
3334
runs-on: ubuntu-latest
3435
steps:
@@ -67,7 +68,6 @@ jobs:
6768

6869
test-build:
6970
runs-on: ubuntu-latest
70-
needs: test
7171

7272
steps:
7373
- name: Checkout code

eslint.config.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,11 @@ export default [
1010
'coverage/**',
1111
'**/*.js',
1212
'**/*.d.ts',
13-
'dist/**',
14-
'tests/**',
15-
'*.config.ts',
16-
'*.config.js'
13+
'dist/**'
1714
]
1815
},
1916
{
20-
files: ['src/**/*.ts'],
17+
files: ['**/*.ts'],
2118
languageOptions: {
2219
parser: tsparser,
2320
parserOptions: {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"main": "build/index.js",
66
"type": "module",
77
"scripts": {
8-
"build": "tsc",
8+
"build": "tsc -p tsconfig.build.json",
99
"dev": "tsc --watch",
1010
"start": "node build/index.js --http",
1111
"start:stdio": "node build/index.js",

tests/tools-config.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ describe('Tools Configuration', () => {
5858
it('should have valid CRUD operations for all tools', () => {
5959
const validOperations = ['C', 'R', 'U', 'D'];
6060

61-
for (const [category, config] of Object.entries(TOOL_CATEGORIES)) {
62-
for (const [tool, operation] of Object.entries(config.operations)) {
61+
for (const [_category, config] of Object.entries(TOOL_CATEGORIES)) {
62+
for (const [_tool, operation] of Object.entries(config.operations)) {
6363
expect(validOperations).toContain(operation);
6464
}
6565
}

tests/tools.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { describe, it, expect, beforeEach } from 'vitest';
2-
import { ErrorCode } from '@modelcontextprotocol/sdk/types.js';
32
import {
43
normalizeServerUrl,
54
parseTimeout,

tsconfig.build.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"rootDir": "./src",
5+
"outDir": "./build"
6+
},
7+
"include": [
8+
"src/**/*"
9+
],
10+
"exclude": [
11+
"node_modules",
12+
"build",
13+
"tests",
14+
"examples",
15+
"**/*.test.ts",
16+
"**/*.spec.ts"
17+
]
18+
}

tsconfig.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
"target": "ES2022",
44
"module": "ESNext",
55
"moduleResolution": "node",
6-
"lib": ["ES2022"],
6+
"lib": [
7+
"ES2022"
8+
],
79
"outDir": "./build",
8-
"rootDir": "./src",
910
"strict": true,
1011
"esModuleInterop": true,
1112
"skipLibCheck": true,
@@ -17,12 +18,13 @@
1718
"allowSyntheticDefaultImports": true
1819
},
1920
"include": [
20-
"src/**/*"
21+
"src/**/*",
22+
"tests/**/*",
23+
"*.config.ts"
2124
],
2225
"exclude": [
2326
"node_modules",
2427
"build",
25-
"tests",
2628
"examples"
2729
]
28-
}
30+
}

0 commit comments

Comments
 (0)