Skip to content

Commit 0067a00

Browse files
committed
bring back accidental in-memory.test.ts miss
1 parent 60de202 commit 0067a00

File tree

10 files changed

+985
-48
lines changed

10 files changed

+985
-48
lines changed

packages/core/test/experimental/in-memory.test.ts

Lines changed: 937 additions & 0 deletions
Large diffs are not rendered by default.

packages/core/test/inMemory.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import type { AuthInfo,JSONRPCMessage } from '../src/types/types.js';
12
import { InMemoryTransport } from '../src/util/inMemory.js';
2-
import type { JSONRPCMessage, AuthInfo } from '../src/types/types.js';
33

44
describe('InMemoryTransport', () => {
55
let clientTransport: InMemoryTransport;

packages/core/test/shared/auth-utils.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { resourceUrlFromServerUrl, checkResourceAllowed } from '../../src/shared/auth-utils.js';
1+
import { checkResourceAllowed,resourceUrlFromServerUrl } from '../../src/shared/auth-utils.js';
22

33
describe('auth-utils', () => {
44
describe('resourceUrlFromServerUrl', () => {

packages/core/test/shared/auth.test.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import {
2-
SafeUrlSchema,
2+
OAuthClientMetadataSchema,
33
OAuthMetadataSchema,
44
OpenIdProviderMetadataSchema,
5-
OAuthClientMetadataSchema,
6-
OptionalSafeUrlSchema
7-
} from '../../src/shared/auth.js';
5+
OptionalSafeUrlSchema,
6+
SafeUrlSchema} from '../../src/shared/auth.js';
87

98
describe('SafeUrlSchema', () => {
109
it('accepts valid HTTPS URLs', () => {

packages/core/test/shared/protocol-transport-handling.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import { describe, expect, test, beforeEach } from 'vitest';
1+
import { beforeEach,describe, expect, test } from 'vitest';
2+
import * as z from 'zod/v4';
3+
24
import { Protocol } from '../../src/shared/protocol.js';
35
import type { Transport } from '../../src/shared/transport.js';
4-
import type { Request, Notification, Result, JSONRPCMessage } from '../../src/types/types.js';
5-
import * as z from 'zod/v4';
6+
import type { JSONRPCMessage,Notification, Request, Result } from '../../src/types/types.js';
67

78
// Mock Transport class
89
class MockTransport implements Transport {

packages/core/test/shared/protocol.test.ts

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,33 @@
1+
import type { MockInstance } from 'vitest';
2+
import { vi } from 'vitest';
13
import type { ZodType } from 'zod';
24
import { z } from 'zod';
5+
6+
import type {
7+
QueuedMessage,
8+
QueuedNotification,
9+
QueuedRequest,
10+
TaskMessageQueue,
11+
TaskStore} from '../../src/experimental/tasks/interfaces.js';
12+
import { InMemoryTaskMessageQueue } from '../../src/experimental/tasks/stores/in-memory.js';
13+
import { mergeCapabilities,Protocol } from '../../src/shared/protocol.js';
14+
import type { ErrorMessage, ResponseMessage } from '../../src/shared/responseMessage.js';
15+
import { toArrayAsync } from '../../src/shared/responseMessage.js';
16+
import type { Transport, TransportSendOptions } from '../../src/shared/transport.js';
317
import type {
418
ClientCapabilities,
19+
JSONRPCErrorResponse,
520
JSONRPCMessage,
21+
JSONRPCRequest,
22+
JSONRPCResultResponse,
23+
Notification,
24+
Request,
625
RequestId,
26+
Result,
727
ServerCapabilities,
828
Task,
9-
TaskCreationParams,
10-
Request,
11-
Notification,
12-
Result,
13-
JSONRPCResultResponse,
14-
JSONRPCRequest,
15-
JSONRPCErrorResponse
16-
} from '../../src/types/types.js';
29+
TaskCreationParams} from '../../src/types/types.js';
1730
import { CallToolRequestSchema, ErrorCode, McpError, RELATED_TASK_META_KEY } from '../../src/types/types.js';
18-
import { Protocol, mergeCapabilities } from '../../src/shared/protocol.js';
19-
import type { Transport, TransportSendOptions } from '../../src/shared/transport.js';
20-
import type {
21-
TaskStore,
22-
TaskMessageQueue,
23-
QueuedMessage,
24-
QueuedNotification,
25-
QueuedRequest
26-
} from '../../src/experimental/tasks/interfaces.js';
27-
import type { MockInstance } from 'vitest';
28-
import { vi } from 'vitest';
29-
import type { ErrorMessage, ResponseMessage } from '../../src/shared/responseMessage.js';
30-
import { toArrayAsync } from '../../src/shared/responseMessage.js';
31-
import { InMemoryTaskMessageQueue } from '../../src/experimental/tasks/stores/in-memory.js';
3231

3332
// Type helper for accessing private/protected Protocol properties in tests
3433
interface TestProtocol {

packages/core/test/shared/stdio.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { JSONRPCMessage } from '../../src/types/types.js';
21
import { ReadBuffer } from '../../src/shared/stdio.js';
2+
import type { JSONRPCMessage } from '../../src/types/types.js';
33

44
const testMessage: JSONRPCMessage = {
55
jsonrpc: '2.0',

packages/core/test/shared/toolNameValidation.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import { validateToolName, validateAndWarnToolName, issueToolNameWarning } from '../../src/shared/toolNameValidation.js';
2-
import { vi } from 'vitest';
31
import type { MockInstance } from 'vitest';
2+
import { vi } from 'vitest';
3+
4+
import { issueToolNameWarning,validateAndWarnToolName, validateToolName } from '../../src/shared/toolNameValidation.js';
45

56
// Spy on console.warn to capture output
67
let warnSpy: MockInstance;

packages/core/test/spec.types.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
* - Runtime checks to verify each Spec type has a static check
66
* (note: a few don't have SDK types, see MISSING_SDK_TYPES below)
77
*/
8-
import type * as SDKTypes from '../src/types/types.js';
9-
import type * as SpecTypes from '../src/types/spec.types.js';
108
import fs from 'node:fs';
119
import path from 'node:path';
1210

11+
import type * as SpecTypes from '../src/types/spec.types.js';
12+
import type * as SDKTypes from '../src/types/types.js';
13+
1314
/* eslint-disable @typescript-eslint/no-unused-vars */
1415
/* eslint-disable @typescript-eslint/no-unsafe-function-type */
1516

packages/core/test/types.test.ts

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
import {
2-
LATEST_PROTOCOL_VERSION,
3-
SUPPORTED_PROTOCOL_VERSIONS,
4-
ResourceLinkSchema,
5-
ContentBlockSchema,
6-
PromptMessageSchema,
72
CallToolResultSchema,
3+
ClientCapabilitiesSchema,
84
CompleteRequestSchema,
9-
ToolSchema,
10-
ToolUseContentSchema,
11-
ToolResultContentSchema,
12-
ToolChoiceSchema,
13-
SamplingMessageSchema,
5+
ContentBlockSchema,
146
CreateMessageRequestSchema,
157
CreateMessageResultSchema,
168
CreateMessageResultWithToolsSchema,
17-
ClientCapabilitiesSchema
18-
} from '../src/types/types.js';
9+
LATEST_PROTOCOL_VERSION,
10+
PromptMessageSchema,
11+
ResourceLinkSchema,
12+
SamplingMessageSchema,
13+
SUPPORTED_PROTOCOL_VERSIONS,
14+
ToolChoiceSchema,
15+
ToolResultContentSchema,
16+
ToolSchema,
17+
ToolUseContentSchema} from '../src/types/types.js';
1918

2019
describe('Types', () => {
2120
test('should have correct latest protocol version', () => {

0 commit comments

Comments
 (0)