Migrate to vitest from jest (#1074)
Co-authored-by: Felix Weinberger <3823880+felixweinberger@users.noreply.github.com> Co-authored-by: Felix Weinberger <fweinberger@anthropic.com>
This commit is contained in:
parent
324d471158
commit
98df118a4c
1 changed files with 1713 additions and 3434 deletions
|
|
@ -27,9 +27,9 @@ import { InMemoryTransport } from '../inMemory.js';
|
|||
*/
|
||||
test('should initialize with matching protocol version', async () => {
|
||||
const clientTransport: Transport = {
|
||||
start: jest.fn().mockResolvedValue(undefined),
|
||||
close: jest.fn().mockResolvedValue(undefined),
|
||||
send: jest.fn().mockImplementation(message => {
|
||||
start: vi.fn().mockResolvedValue(undefined),
|
||||
close: vi.fn().mockResolvedValue(undefined),
|
||||
send: vi.fn().mockImplementation(message => {
|
||||
if (message.method === 'initialize') {
|
||||
clientTransport.onmessage?.({
|
||||
jsonrpc: '2.0',
|
||||
|
|
@ -86,9 +86,9 @@ test('should initialize with matching protocol version', async () => {
|
|||
test('should initialize with supported older protocol version', async () => {
|
||||
const OLD_VERSION = SUPPORTED_PROTOCOL_VERSIONS[1];
|
||||
const clientTransport: Transport = {
|
||||
start: jest.fn().mockResolvedValue(undefined),
|
||||
close: jest.fn().mockResolvedValue(undefined),
|
||||
send: jest.fn().mockImplementation(message => {
|
||||
start: vi.fn().mockResolvedValue(undefined),
|
||||
close: vi.fn().mockResolvedValue(undefined),
|
||||
send: vi.fn().mockImplementation(message => {
|
||||
if (message.method === 'initialize') {
|
||||
clientTransport.onmessage?.({
|
||||
jsonrpc: '2.0',
|
||||
|
|
@ -136,9 +136,9 @@ test('should initialize with supported older protocol version', async () => {
|
|||
*/
|
||||
test('should reject unsupported protocol version', async () => {
|
||||
const clientTransport: Transport = {
|
||||
start: jest.fn().mockResolvedValue(undefined),
|
||||
close: jest.fn().mockResolvedValue(undefined),
|
||||
send: jest.fn().mockImplementation(message => {
|
||||
start: vi.fn().mockResolvedValue(undefined),
|
||||
close: vi.fn().mockResolvedValue(undefined),
|
||||
send: vi.fn().mockImplementation(message => {
|
||||
if (message.method === 'initialize') {
|
||||
clientTransport.onmessage?.({
|
||||
jsonrpc: '2.0',
|
||||
|
|
|
|||
Loading…
Reference in a new issue