Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
const tsConfig = {
useESM: true,
tsconfig: '<rootDir>/tsconfig.json'
};

const baseConfig = {
extensionsToTreatAsEsm: ['.ts'],
preset: 'ts-jest',
Expand All @@ -7,8 +12,7 @@ const baseConfig = {
'^.+\\.(ts|tsx)$': [
'ts-jest',
{
useESM: true,
tsconfig: '<rootDir>/tsconfig.json'
...tsConfig
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion jest.setupTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ process.env.NODE_ENV = 'local';
*/
jest.mock('child_process', () => ({
...jest.requireActual('child_process'),
execSync: (...args: any) => `<execSync>${JSON.stringify(args)}</execSync>`
execSync: (...args: unknown[]) => `<execSync>${JSON.stringify(args)}</execSync>`
}));

/**
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
"release": "changelog --non-cc --link-url https://github.com/patternfly/patternfly-mcp.git",
"start": "node dist/cli.js --log-stderr",
"start:dev": "tsx watch src/cli.ts --verbose --log-stderr",
"test": "npm run test:lint && npm run test:types && jest --roots=src/",
"test": "npm run test:lint && npm run test:types && jest --selectProjects unit --roots=src/",
"test:dev": "npm test -- --watchAll",
"test:integration": "npm run build && NODE_OPTIONS='--experimental-vm-modules' jest --roots=tests/",
"test:integration": "npm run build && NODE_OPTIONS='--experimental-vm-modules' jest --selectProjects e2e --roots=tests/",
"test:integration-dev": "npm run test:integration -- --watchAll",
"test:lint": "eslint .",
"test:lint-fix": "eslint . --fix",
Expand Down
9 changes: 9 additions & 0 deletions tests/utils/httpTransportClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ export interface HttpTransportClient {
/**
* Start an HTTP server using the programmatic API and return a client for testing
*
* Logging notes. Logging does work with HTTP transport, with conditions
* - You need to set `logging.protocol` to true to enable protocol logging
* - Stdio transport logs technically work but they will bleed through to the testing framework
* console and aren't currently captured by this client.
* - Captured logs are dependent on server start up and shutdown. This means you need to provide
* a "pause", like placing the server startup in a "beforeAll" to reliably capture most logs.
* - Currently, the SDK does not support this object format `capabilities: { logging: {} }`. Typings
* should throw an error if you try to use it.
*
* @param options - Server configuration options
* @param settings - Additional settings for the server (e.g., allowProcessExit)
*/
Expand Down
Loading