Skip to content

Commit ce4aba9

Browse files
committed
reformat
1 parent b531067 commit ce4aba9

File tree

3 files changed

+145
-147
lines changed

3 files changed

+145
-147
lines changed

.github/workflows/code_health.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ jobs:
3434
- name: Build project
3535
run: npm run build
3636
- name: Run tests
37-
run: npm test
37+
run: npm test

jest.config.js

Lines changed: 143 additions & 145 deletions
Original file line numberDiff line numberDiff line change
@@ -5,203 +5,201 @@
55

66
/** @type {import('jest').Config} */
77
const config = {
8-
// All imported modules in your tests should be mocked automatically
9-
// automock: false,
8+
// All imported modules in your tests should be mocked automatically
9+
// automock: false,
1010

11-
// Stop running tests after `n` failures
12-
// bail: 0,
11+
// Stop running tests after `n` failures
12+
// bail: 0,
1313

14-
// The directory where Jest should store its cached dependency information
15-
// cacheDirectory: "/private/var/folders/4_/m2t0ys455s308pbmbv71ft1w0000gp/T/jest_dy",
14+
// The directory where Jest should store its cached dependency information
15+
// cacheDirectory: "/private/var/folders/4_/m2t0ys455s308pbmbv71ft1w0000gp/T/jest_dy",
1616

17-
// Automatically clear mock calls, instances, contexts and results before every test
18-
// clearMocks: false,
17+
// Automatically clear mock calls, instances, contexts and results before every test
18+
// clearMocks: false,
1919

20-
// Indicates whether the coverage information should be collected while executing the test
21-
// collectCoverage: false,
20+
// Indicates whether the coverage information should be collected while executing the test
21+
// collectCoverage: false,
2222

23-
// An array of glob patterns indicating a set of files for which coverage information should be collected
24-
// collectCoverageFrom: undefined,
23+
// An array of glob patterns indicating a set of files for which coverage information should be collected
24+
// collectCoverageFrom: undefined,
2525

26-
// The directory where Jest should output its coverage files
27-
// coverageDirectory: undefined,
26+
// The directory where Jest should output its coverage files
27+
// coverageDirectory: undefined,
2828

29-
// An array of regexp pattern strings used to skip coverage collection
30-
// coveragePathIgnorePatterns: [
31-
// "/node_modules/"
32-
// ],
29+
// An array of regexp pattern strings used to skip coverage collection
30+
// coveragePathIgnorePatterns: [
31+
// "/node_modules/"
32+
// ],
3333

34-
// Indicates which provider should be used to instrument code for coverage
35-
// coverageProvider: "babel",
34+
// Indicates which provider should be used to instrument code for coverage
35+
// coverageProvider: "babel",
3636

37-
// A list of reporter names that Jest uses when writing coverage reports
38-
// coverageReporters: [
39-
// "json",
40-
// "text",
41-
// "lcov",
42-
// "clover"
43-
// ],
37+
// A list of reporter names that Jest uses when writing coverage reports
38+
// coverageReporters: [
39+
// "json",
40+
// "text",
41+
// "lcov",
42+
// "clover"
43+
// ],
4444

45-
// An object that configures minimum threshold enforcement for coverage results
46-
// coverageThreshold: undefined,
45+
// An object that configures minimum threshold enforcement for coverage results
46+
// coverageThreshold: undefined,
4747

48-
// A path to a custom dependency extractor
49-
// dependencyExtractor: undefined,
48+
// A path to a custom dependency extractor
49+
// dependencyExtractor: undefined,
5050

51-
// Make calling deprecated APIs throw helpful error messages
52-
// errorOnDeprecated: false,
51+
// Make calling deprecated APIs throw helpful error messages
52+
// errorOnDeprecated: false,
5353

54-
// The default configuration for fake timers
55-
// fakeTimers: {
56-
// "enableGlobally": false
57-
// },
54+
// The default configuration for fake timers
55+
// fakeTimers: {
56+
// "enableGlobally": false
57+
// },
5858

59-
// Force coverage collection from ignored files using an array of glob patterns
60-
// forceCoverageMatch: [],
59+
// Force coverage collection from ignored files using an array of glob patterns
60+
// forceCoverageMatch: [],
6161

62-
// A path to a module which exports an async function that is triggered once before all test suites
63-
// globalSetup: undefined,
62+
// A path to a module which exports an async function that is triggered once before all test suites
63+
// globalSetup: undefined,
6464

65-
// A path to a module which exports an async function that is triggered once after all test suites
66-
// globalTeardown: undefined,
65+
// A path to a module which exports an async function that is triggered once after all test suites
66+
// globalTeardown: undefined,
6767

68-
// A set of global variables that need to be available in all test environments
69-
// globals: {},
68+
// A set of global variables that need to be available in all test environments
69+
// globals: {},
7070

71-
// The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
72-
// maxWorkers: "50%",
71+
// The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
72+
// maxWorkers: "50%",
7373

74-
// An array of directory names to be searched recursively up from the requiring module's location
75-
// moduleDirectories: [
76-
// "node_modules"
77-
// ],
74+
// An array of directory names to be searched recursively up from the requiring module's location
75+
// moduleDirectories: [
76+
// "node_modules"
77+
// ],
7878

79-
// An array of file extensions your modules use
80-
// moduleFileExtensions: [
81-
// "js",
82-
// "mjs",
83-
// "cjs",
84-
// "jsx",
85-
// "ts",
86-
// "tsx",
87-
// "json",
88-
// "node"
89-
// ],
79+
// An array of file extensions your modules use
80+
// moduleFileExtensions: [
81+
// "js",
82+
// "mjs",
83+
// "cjs",
84+
// "jsx",
85+
// "ts",
86+
// "tsx",
87+
// "json",
88+
// "node"
89+
// ],
9090

91-
// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
92-
moduleNameMapper: {
93-
'^(\\.{1,2}/.*)\\.js$': '$1',
94-
},
91+
// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
92+
moduleNameMapper: {
93+
"^(\\.{1,2}/.*)\\.js$": "$1",
94+
},
9595

96-
97-
// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
98-
// modulePathIgnorePatterns: [],
96+
// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
97+
// modulePathIgnorePatterns: [],
9998

100-
// Activates notifications for test results
101-
// notify: false,
99+
// Activates notifications for test results
100+
// notify: false,
102101

103-
// An enum that specifies notification mode. Requires { notify: true }
104-
// notifyMode: "failure-change",
102+
// An enum that specifies notification mode. Requires { notify: true }
103+
// notifyMode: "failure-change",
105104

106-
// A preset that is used as a base for Jest's configuration
107-
preset: 'ts-jest/presets/default-esm',
105+
// A preset that is used as a base for Jest's configuration
106+
preset: "ts-jest/presets/default-esm",
108107

109-
// Run tests from one or more projects
110-
// projects: undefined,
108+
// Run tests from one or more projects
109+
// projects: undefined,
111110

112-
// Use this configuration option to add custom reporters to Jest
113-
// reporters: undefined,
111+
// Use this configuration option to add custom reporters to Jest
112+
// reporters: undefined,
114113

115-
// Automatically reset mock state before every test
116-
// resetMocks: false,
114+
// Automatically reset mock state before every test
115+
// resetMocks: false,
117116

118-
// Reset the module registry before running each individual test
119-
// resetModules: false,
117+
// Reset the module registry before running each individual test
118+
// resetModules: false,
120119

121-
// A path to a custom resolver
122-
// resolver: undefined,
120+
// A path to a custom resolver
121+
// resolver: undefined,
123122

124-
// Automatically restore mock state and implementation before every test
125-
// restoreMocks: false,
123+
// Automatically restore mock state and implementation before every test
124+
// restoreMocks: false,
126125

127-
// The root directory that Jest should scan for tests and modules within
128-
// rootDir: undefined,
126+
// The root directory that Jest should scan for tests and modules within
127+
// rootDir: undefined,
129128

130-
// A list of paths to directories that Jest should use to search for files in
131-
// roots: [
132-
// "<rootDir>"
133-
// ],
129+
// A list of paths to directories that Jest should use to search for files in
130+
// roots: [
131+
// "<rootDir>"
132+
// ],
134133

135-
// Allows you to use a custom runner instead of Jest's default test runner
136-
// runner: "jest-runner",
134+
// Allows you to use a custom runner instead of Jest's default test runner
135+
// runner: "jest-runner",
137136

138-
// The paths to modules that run some code to configure or set up the testing environment before each test
139-
// setupFiles: [],
137+
// The paths to modules that run some code to configure or set up the testing environment before each test
138+
// setupFiles: [],
140139

141-
// A list of paths to modules that run some code to configure or set up the testing framework before each test
142-
// setupFilesAfterEnv: [],
140+
// A list of paths to modules that run some code to configure or set up the testing framework before each test
141+
// setupFilesAfterEnv: [],
143142

144-
// The number of seconds after which a test is considered as slow and reported as such in the results.
145-
// slowTestThreshold: 5,
143+
// The number of seconds after which a test is considered as slow and reported as such in the results.
144+
// slowTestThreshold: 5,
146145

147-
// A list of paths to snapshot serializer modules Jest should use for snapshot testing
148-
// snapshotSerializers: [],
146+
// A list of paths to snapshot serializer modules Jest should use for snapshot testing
147+
// snapshotSerializers: [],
149148

150-
// The test environment that will be used for testing
151-
testEnvironment: "node",
152-
extensionsToTreatAsEsm: ['.ts'],
149+
// The test environment that will be used for testing
150+
testEnvironment: "node",
151+
extensionsToTreatAsEsm: [".ts"],
153152

154-
// Options that will be passed to the testEnvironment
155-
// testEnvironmentOptions: {},
153+
// Options that will be passed to the testEnvironment
154+
// testEnvironmentOptions: {},
156155

157-
// Adds a location field to test results
158-
// testLocationInResults: false,
156+
// Adds a location field to test results
157+
// testLocationInResults: false,
159158

160-
// The glob patterns Jest uses to detect test files
161-
testMatch: [
162-
"**/__tests__/**/*.[jt]s?(x)",
163-
"**/?(*.)+(spec|test).[tj]s?(x)"
164-
],
159+
// The glob patterns Jest uses to detect test files
160+
testMatch: ["**/__tests__/**/*.[jt]s?(x)", "**/?(*.)+(spec|test).[tj]s?(x)"],
165161

166-
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
167-
// testPathIgnorePatterns: [
168-
// "/node_modules/"
169-
// ],
162+
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
163+
// testPathIgnorePatterns: [
164+
// "/node_modules/"
165+
// ],
170166

171-
// The regexp pattern or array of patterns that Jest uses to detect test files
172-
// testRegex: [],
167+
// The regexp pattern or array of patterns that Jest uses to detect test files
168+
// testRegex: [],
173169

174-
// This option allows the use of a custom results processor
175-
// testResultsProcessor: undefined,
170+
// This option allows the use of a custom results processor
171+
// testResultsProcessor: undefined,
176172

177-
// This option allows use of a custom test runner
178-
// testRunner: "jest-circus/runner",
173+
// This option allows use of a custom test runner
174+
// testRunner: "jest-circus/runner",
179175

180-
// A map from regular expressions to paths to transformers
181-
transform: {
182-
'^.+\\.tsx?$': ['ts-jest', {
183-
useESM: true,
184-
}],
185-
},
176+
// A map from regular expressions to paths to transformers
177+
transform: {
178+
"^.+\\.tsx?$": [
179+
"ts-jest",
180+
{
181+
useESM: true,
182+
},
183+
],
184+
},
186185

187-
188-
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
189-
// transformIgnorePatterns: [
190-
// "/node_modules/",
191-
// "\\.pnp\\.[^\\/]+$"
192-
// ],
186+
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
187+
// transformIgnorePatterns: [
188+
// "/node_modules/",
189+
// "\\.pnp\\.[^\\/]+$"
190+
// ],
193191

194-
// An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
195-
// unmockedModulePathPatterns: undefined,
192+
// An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
193+
// unmockedModulePathPatterns: undefined,
196194

197-
// Indicates whether each individual test should be reported during the run
198-
// verbose: undefined,
195+
// Indicates whether each individual test should be reported during the run
196+
// verbose: undefined,
199197

200-
// An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
201-
// watchPathIgnorePatterns: [],
198+
// An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
199+
// watchPathIgnorePatterns: [],
202200

203-
// Whether to use watchman for file crawling
204-
// watchman: true,
201+
// Whether to use watchman for file crawling
202+
// watchman: true,
205203
};
206204

207205
export default config;

tests/unit/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { Transport } from "@modelcontextprotocol/sdk/shared/transport";
33

44
// Mock modules with proper typing
55
jest.mock("@modelcontextprotocol/sdk/server/stdio", () => ({
6-
StdioServerTransport: jest.fn().mockImplementation(() => ({} as Transport)),
6+
StdioServerTransport: jest.fn().mockImplementation(() => ({}) as Transport),
77
}));
88

99
// Properly type the mock function to return Promise<void>

0 commit comments

Comments
 (0)