diff --git a/test/integration/bun-types/bun-types.test.ts b/test/integration/bun-types/bun-types.test.ts index 0a0d98e5de..31d2b1b1f5 100644 --- a/test/integration/bun-types/bun-types.test.ts +++ b/test/integration/bun-types/bun-types.test.ts @@ -264,14 +264,16 @@ afterAll(async () => { }); describe("@types/bun integration test", () => { - test("checks without lib.dom.d.ts", async () => { - const { diagnostics, emptyInterfaces } = await diagnose(TEMP_FIXTURE_DIR); + describe("basic type checks", () => { + test("checks without lib.dom.d.ts", async () => { + const { diagnostics, emptyInterfaces } = await diagnose(TEMP_FIXTURE_DIR); - expect(emptyInterfaces).toEqual(expectedEmptyInterfacesWhenNoDOM); - expect(diagnostics).toEqual([]); + expect(emptyInterfaces).toEqual(expectedEmptyInterfacesWhenNoDOM); + expect(diagnostics).toEqual([]); + }); }); - describe("test-globals reference", () => { + describe("Test Globals", () => { const code = ` const test_shouldBeAFunction: Function = test; const it_shouldBeAFunction: Function = it; @@ -360,7 +362,7 @@ describe("@types/bun integration test", () => { }); }); - describe("bun:bundle feature() type safety with Registry", () => { + describe("bun:bundle feature()", () => { test("Registry augmentation restricts feature() to known flags", async () => { const testCode = ` // Augment the Registry to define known flags @@ -454,294 +456,300 @@ describe("@types/bun integration test", () => { }); }); - test("checks with no lib at all", async () => { - const { diagnostics, emptyInterfaces } = await diagnose(TEMP_FIXTURE_DIR, { - options: { - lib: [], - }, + describe("lib configuration", () => { + test("checks with no lib at all", async () => { + const { diagnostics, emptyInterfaces } = await diagnose(TEMP_FIXTURE_DIR, { + options: { + lib: [], + }, + }); + + expect(emptyInterfaces).toEqual(expectedEmptyInterfacesWhenNoDOM); + expect(diagnostics).toEqual([]); }); - expect(emptyInterfaces).toEqual(expectedEmptyInterfacesWhenNoDOM); - expect(diagnostics).toEqual([]); - }); + test("fails with types: [] and no jsx", async () => { + const { diagnostics, emptyInterfaces } = await diagnose(TEMP_FIXTURE_DIR, { + options: { + lib: [], + types: [], + jsx: ts.JsxEmit.None, + }, + }); - test("fails with types: [] and no jsx", async () => { - const { diagnostics, emptyInterfaces } = await diagnose(TEMP_FIXTURE_DIR, { - options: { - lib: [], - types: [], - jsx: ts.JsxEmit.None, - }, + expect(emptyInterfaces).toEqual(expectedEmptyInterfacesWhenNoDOM); + expect(diagnostics).toEqual([ + // // This is expected because we, of course, can't check that our tsx file is passing + // // when tsx is turned off... + // { + // "code": 17004, + // "line": "[slug].tsx:17:10", + // "message": "Cannot use JSX unless the '--jsx' flag is provided.", + // }, + ]); }); - expect(emptyInterfaces).toEqual(expectedEmptyInterfacesWhenNoDOM); - expect(diagnostics).toEqual([ - // // This is expected because we, of course, can't check that our tsx file is passing - // // when tsx is turned off... - // { - // "code": 17004, - // "line": "[slug].tsx:17:10", - // "message": "Cannot use JSX unless the '--jsx' flag is provided.", - // }, - ]); - }); + test("checks with lib.dom.d.ts", async () => { + const { diagnostics, emptyInterfaces } = await diagnose(TEMP_FIXTURE_DIR, { + options: { + lib: ["ESNext", "DOM", "DOM.Iterable", "DOM.AsyncIterable"].map(name => `lib.${name.toLowerCase()}.d.ts`), + }, + }); - test("checks with lib.dom.d.ts", async () => { - const { diagnostics, emptyInterfaces } = await diagnose(TEMP_FIXTURE_DIR, { - options: { - lib: ["ESNext", "DOM", "DOM.Iterable", "DOM.AsyncIterable"].map(name => `lib.${name.toLowerCase()}.d.ts`), - }, + expect(emptyInterfaces).toEqual( + new Set([ + "ThisType", + "RTCAnswerOptions", + "RTCOfferAnswerOptions", + "RTCSetParameterOptions", + "EXT_color_buffer_float", + "EXT_float_blend", + "EXT_frag_depth", + "EXT_shader_texture_lod", + "FragmentDirective", + "MediaSourceHandle", + "OES_element_index_uint", + "OES_fbo_render_mipmap", + "OES_texture_float", + "OES_texture_float_linear", + "OES_texture_half_float_linear", + "PeriodicWave", + "RTCRtpScriptTransform", + "WebGLBuffer", + "WebGLFramebuffer", + "WebGLProgram", + "WebGLQuery", + "WebGLRenderbuffer", + "WebGLSampler", + "WebGLShader", + "WebGLSync", + "WebGLTexture", + "WebGLTransformFeedback", + "WebGLUniformLocation", + "WebGLVertexArrayObject", + "WebGLVertexArrayObjectOES", + ]), + ); + expect(diagnostics).toEqual([ + { + code: 2322, + line: "24154.ts:11:3", + message: + "Type 'Blob' is not assignable to type 'import(\"node:buffer\").Blob'.\nThe types returned by 'stream()' are incompatible between these types.\nType 'ReadableStream>' is missing the following properties from type 'ReadableStream': blob, text, bytes, json", + }, + { + code: 2769, + line: "fetch.ts:25:32", + message: + "No overload matches this call.\nOverload 1 of 3, '(input: string | Request | URL, init?: RequestInit | undefined): Promise', gave the following error.\nType 'AsyncGenerator<\"chunk1\" | \"chunk2\", void, unknown>' is not assignable to type 'BodyInit | null | undefined'.\nType 'AsyncGenerator<\"chunk1\" | \"chunk2\", void, unknown>' is missing the following properties from type 'ReadableStream': locked, cancel, getReader, pipeThrough, and 3 more.\nOverload 2 of 3, '(input: string | Request | URL, init?: BunFetchRequestInit | undefined): Promise', gave the following error.\nType 'AsyncGenerator<\"chunk1\" | \"chunk2\", void, unknown>' is not assignable to type 'BodyInit | null | undefined'.\nType 'AsyncGenerator<\"chunk1\" | \"chunk2\", void, unknown>' is missing the following properties from type 'ReadableStream': locked, cancel, getReader, pipeThrough, and 3 more.\nOverload 3 of 3, '(input: RequestInfo | URL, init?: RequestInit | undefined): Promise', gave the following error.\nType 'AsyncGenerator<\"chunk1\" | \"chunk2\", void, unknown>' is not assignable to type 'BodyInit | null | undefined'.\nType 'AsyncGenerator<\"chunk1\" | \"chunk2\", void, unknown>' is missing the following properties from type 'ReadableStream': locked, cancel, getReader, pipeThrough, and 3 more.", + }, + { + code: 2769, + line: "fetch.ts:33:32", + message: + "No overload matches this call.\nOverload 1 of 3, '(input: string | Request | URL, init?: RequestInit | undefined): Promise', gave the following error.\nType '{ [Symbol.asyncIterator](): AsyncGenerator<\"data1\" | \"data2\", void, unknown>; }' is not assignable to type 'BodyInit | null | undefined'.\nType '{ [Symbol.asyncIterator](): AsyncGenerator<\"data1\" | \"data2\", void, unknown>; }' is missing the following properties from type 'ReadableStream': locked, cancel, getReader, pipeThrough, and 3 more.\nOverload 2 of 3, '(input: string | Request | URL, init?: BunFetchRequestInit | undefined): Promise', gave the following error.\nType '{ [Symbol.asyncIterator](): AsyncGenerator<\"data1\" | \"data2\", void, unknown>; }' is not assignable to type 'BodyInit | null | undefined'.\nType '{ [Symbol.asyncIterator](): AsyncGenerator<\"data1\" | \"data2\", void, unknown>; }' is missing the following properties from type 'ReadableStream': locked, cancel, getReader, pipeThrough, and 3 more.\nOverload 3 of 3, '(input: RequestInfo | URL, init?: RequestInit | undefined): Promise', gave the following error.\nType '{ [Symbol.asyncIterator](): AsyncGenerator<\"data1\" | \"data2\", void, unknown>; }' is not assignable to type 'BodyInit | null | undefined'.\nType '{ [Symbol.asyncIterator](): AsyncGenerator<\"data1\" | \"data2\", void, unknown>; }' is missing the following properties from type 'ReadableStream': locked, cancel, getReader, pipeThrough, and 3 more.", + }, + { + code: 2769, + line: "fetch.ts:168:34", + message: + "No overload matches this call.\nOverload 1 of 3, '(input: string | Request | URL, init?: RequestInit | undefined): Promise', gave the following error.\nType 'SharedArrayBuffer' is not assignable to type 'BodyInit | null | undefined'.\nType 'SharedArrayBuffer' is missing the following properties from type 'ArrayBuffer': resizable, resize, detached, transfer, transferToFixedLength\nOverload 2 of 3, '(input: string | Request | URL, init?: BunFetchRequestInit | undefined): Promise', gave the following error.\nType 'SharedArrayBuffer' is not assignable to type 'BodyInit | null | undefined'.\nType 'SharedArrayBuffer' is missing the following properties from type 'ArrayBuffer': resizable, resize, detached, transfer, transferToFixedLength\nOverload 3 of 3, '(input: RequestInfo | URL, init?: RequestInit | undefined): Promise', gave the following error.\nType 'SharedArrayBuffer' is not assignable to type 'BodyInit | null | undefined'.\nType 'SharedArrayBuffer' is missing the following properties from type 'ArrayBuffer': resizable, resize, detached, transfer, transferToFixedLength", + }, + { + code: 2353, + line: "globals.ts:307:5", + message: "Object literal may only specify known properties, and 'headers' does not exist in type 'string[]'.", + }, + { + code: 2345, + line: "http.ts:43:24", + message: + "Argument of type '() => AsyncGenerator | \"hey\", void, unknown>' is not assignable to parameter of type 'BodyInit | null | undefined'.", + }, + { + code: 2345, + line: "http.ts:55:24", + message: + "Argument of type 'AsyncGenerator | \"it works!\", void, unknown>' is not assignable to parameter of type 'BodyInit | null | undefined'.\nType 'AsyncGenerator | \"it works!\", void, unknown>' is missing the following properties from type 'ReadableStream': locked, cancel, getReader, pipeThrough, and 3 more.", + }, + { + code: 2345, + line: "index.ts:196:14", + message: + "Argument of type 'AsyncGenerator, void, unknown>' is not assignable to parameter of type 'BodyInit | null | undefined'.\nType 'AsyncGenerator, void, unknown>' is missing the following properties from type 'ReadableStream': locked, cancel, getReader, pipeThrough, and 3 more.", + }, + { + code: 2345, + line: "index.ts:322:29", + message: + "Argument of type '{ headers: { \"x-bun\": string; }; }' is not assignable to parameter of type 'number'.", + }, + { + code: 2339, + line: "spawn.ts:62:38", + message: "Property 'text' does not exist on type 'ReadableStream>'.", + }, + { + code: 2339, + line: "spawn.ts:107:38", + message: "Property 'text' does not exist on type 'ReadableStream>'.", + }, + { + "code": 2769, + "line": "streams.ts:18:3", + "message": + "No overload matches this call.\nOverload 1 of 3, '(underlyingSource: UnderlyingByteSource, strategy?: { highWaterMark?: number | undefined; } | undefined): ReadableStream>', gave the following error.\nType '\"direct\"' is not assignable to type '\"bytes\"'.", + }, + { + "code": 2339, + "line": "streams.ts:20:16", + "message": "Property 'write' does not exist on type 'ReadableByteStreamController'.", + }, + { + "code": 2339, + "line": "streams.ts:46:19", + "message": "Property 'json' does not exist on type 'ReadableStream>'.", + }, + { + "code": 2339, + "line": "streams.ts:47:19", + "message": "Property 'bytes' does not exist on type 'ReadableStream>'.", + }, + { + "code": 2339, + "line": "streams.ts:48:19", + "message": "Property 'text' does not exist on type 'ReadableStream>'.", + }, + { + "code": 2339, + "line": "streams.ts:49:19", + "message": "Property 'blob' does not exist on type 'ReadableStream>'.", + }, + { + code: 2345, + line: "streams.ts:63:66", + message: "Argument of type '\"brotli\"' is not assignable to parameter of type 'CompressionFormat'.", + }, + { + code: 2345, + line: "streams.ts:63:113", + message: "Argument of type '\"brotli\"' is not assignable to parameter of type 'CompressionFormat'.", + }, + { + code: 2345, + line: "streams.ts:64:66", + message: "Argument of type '\"zstd\"' is not assignable to parameter of type 'CompressionFormat'.", + }, + { + code: 2345, + line: "streams.ts:64:111", + message: "Argument of type '\"zstd\"' is not assignable to parameter of type 'CompressionFormat'.", + }, + { + code: 2353, + line: "websocket.ts:25:5", + message: + "Object literal may only specify known properties, and 'protocols' does not exist in type 'string[]'.", + }, + { + code: 2353, + line: "websocket.ts:30:5", + message: + "Object literal may only specify known properties, and 'protocol' does not exist in type 'string[]'.", + }, + { + code: 2353, + line: "websocket.ts:35:5", + message: + "Object literal may only specify known properties, and 'protocol' does not exist in type 'string[]'.", + }, + { + code: 2353, + line: "websocket.ts:43:5", + message: "Object literal may only specify known properties, and 'headers' does not exist in type 'string[]'.", + }, + { + code: 2353, + line: "websocket.ts:51:5", + message: + "Object literal may only specify known properties, and 'protocols' does not exist in type 'string[]'.", + }, + { + code: 2554, + line: "websocket.ts:185:29", + message: "Expected 2 arguments, but got 0.", + }, + { + code: 2551, + line: "websocket.ts:192:17", + message: "Property 'URL' does not exist on type 'WebSocket'. Did you mean 'url'?", + }, + { + code: 2322, + line: "websocket.ts:196:3", + message: "Type '\"nodebuffer\"' is not assignable to type 'BinaryType'.", + }, + { + code: 2339, + line: "websocket.ts:242:6", + message: "Property 'ping' does not exist on type 'WebSocket'.", + }, + { + code: 2339, + line: "websocket.ts:245:6", + message: "Property 'ping' does not exist on type 'WebSocket'.", + }, + { + code: 2339, + line: "websocket.ts:249:6", + message: "Property 'ping' does not exist on type 'WebSocket'.", + }, + { + code: 2339, + line: "websocket.ts:253:6", + message: "Property 'ping' does not exist on type 'WebSocket'.", + }, + { + code: 2339, + line: "websocket.ts:256:6", + message: "Property 'pong' does not exist on type 'WebSocket'.", + }, + { + code: 2339, + line: "websocket.ts:259:6", + message: "Property 'pong' does not exist on type 'WebSocket'.", + }, + { + code: 2339, + line: "websocket.ts:263:6", + message: "Property 'pong' does not exist on type 'WebSocket'.", + }, + { + code: 2339, + line: "websocket.ts:267:6", + message: "Property 'pong' does not exist on type 'WebSocket'.", + }, + { + code: 2339, + line: "websocket.ts:270:6", + message: "Property 'terminate' does not exist on type 'WebSocket'.", + }, + { + code: 2339, + line: "worker.ts:23:11", + message: "Property 'ref' does not exist on type 'Worker'.", + }, + { + code: 2339, + line: "worker.ts:24:11", + message: "Property 'unref' does not exist on type 'Worker'.", + }, + { + code: 2339, + line: "worker.ts:25:11", + message: "Property 'threadId' does not exist on type 'Worker'.", + }, + ]); }); - - expect(emptyInterfaces).toEqual( - new Set([ - "ThisType", - "RTCAnswerOptions", - "RTCOfferAnswerOptions", - "RTCSetParameterOptions", - "EXT_color_buffer_float", - "EXT_float_blend", - "EXT_frag_depth", - "EXT_shader_texture_lod", - "FragmentDirective", - "MediaSourceHandle", - "OES_element_index_uint", - "OES_fbo_render_mipmap", - "OES_texture_float", - "OES_texture_float_linear", - "OES_texture_half_float_linear", - "PeriodicWave", - "RTCRtpScriptTransform", - "WebGLBuffer", - "WebGLFramebuffer", - "WebGLProgram", - "WebGLQuery", - "WebGLRenderbuffer", - "WebGLSampler", - "WebGLShader", - "WebGLSync", - "WebGLTexture", - "WebGLTransformFeedback", - "WebGLUniformLocation", - "WebGLVertexArrayObject", - "WebGLVertexArrayObjectOES", - ]), - ); - expect(diagnostics).toEqual([ - { - code: 2322, - line: "24154.ts:11:3", - message: - "Type 'Blob' is not assignable to type 'import(\"node:buffer\").Blob'.\nThe types returned by 'stream()' are incompatible between these types.\nType 'ReadableStream>' is missing the following properties from type 'ReadableStream': blob, text, bytes, json", - }, - { - code: 2769, - line: "fetch.ts:25:32", - message: - "No overload matches this call.\nOverload 1 of 3, '(input: string | Request | URL, init?: RequestInit | undefined): Promise', gave the following error.\nType 'AsyncGenerator<\"chunk1\" | \"chunk2\", void, unknown>' is not assignable to type 'BodyInit | null | undefined'.\nType 'AsyncGenerator<\"chunk1\" | \"chunk2\", void, unknown>' is missing the following properties from type 'ReadableStream': locked, cancel, getReader, pipeThrough, and 3 more.\nOverload 2 of 3, '(input: string | Request | URL, init?: BunFetchRequestInit | undefined): Promise', gave the following error.\nType 'AsyncGenerator<\"chunk1\" | \"chunk2\", void, unknown>' is not assignable to type 'BodyInit | null | undefined'.\nType 'AsyncGenerator<\"chunk1\" | \"chunk2\", void, unknown>' is missing the following properties from type 'ReadableStream': locked, cancel, getReader, pipeThrough, and 3 more.\nOverload 3 of 3, '(input: RequestInfo | URL, init?: RequestInit | undefined): Promise', gave the following error.\nType 'AsyncGenerator<\"chunk1\" | \"chunk2\", void, unknown>' is not assignable to type 'BodyInit | null | undefined'.\nType 'AsyncGenerator<\"chunk1\" | \"chunk2\", void, unknown>' is missing the following properties from type 'ReadableStream': locked, cancel, getReader, pipeThrough, and 3 more.", - }, - { - code: 2769, - line: "fetch.ts:33:32", - message: - "No overload matches this call.\nOverload 1 of 3, '(input: string | Request | URL, init?: RequestInit | undefined): Promise', gave the following error.\nType '{ [Symbol.asyncIterator](): AsyncGenerator<\"data1\" | \"data2\", void, unknown>; }' is not assignable to type 'BodyInit | null | undefined'.\nType '{ [Symbol.asyncIterator](): AsyncGenerator<\"data1\" | \"data2\", void, unknown>; }' is missing the following properties from type 'ReadableStream': locked, cancel, getReader, pipeThrough, and 3 more.\nOverload 2 of 3, '(input: string | Request | URL, init?: BunFetchRequestInit | undefined): Promise', gave the following error.\nType '{ [Symbol.asyncIterator](): AsyncGenerator<\"data1\" | \"data2\", void, unknown>; }' is not assignable to type 'BodyInit | null | undefined'.\nType '{ [Symbol.asyncIterator](): AsyncGenerator<\"data1\" | \"data2\", void, unknown>; }' is missing the following properties from type 'ReadableStream': locked, cancel, getReader, pipeThrough, and 3 more.\nOverload 3 of 3, '(input: RequestInfo | URL, init?: RequestInit | undefined): Promise', gave the following error.\nType '{ [Symbol.asyncIterator](): AsyncGenerator<\"data1\" | \"data2\", void, unknown>; }' is not assignable to type 'BodyInit | null | undefined'.\nType '{ [Symbol.asyncIterator](): AsyncGenerator<\"data1\" | \"data2\", void, unknown>; }' is missing the following properties from type 'ReadableStream': locked, cancel, getReader, pipeThrough, and 3 more.", - }, - { - code: 2769, - line: "fetch.ts:168:34", - message: - "No overload matches this call.\nOverload 1 of 3, '(input: string | Request | URL, init?: RequestInit | undefined): Promise', gave the following error.\nType 'SharedArrayBuffer' is not assignable to type 'BodyInit | null | undefined'.\nType 'SharedArrayBuffer' is missing the following properties from type 'ArrayBuffer': resizable, resize, detached, transfer, transferToFixedLength\nOverload 2 of 3, '(input: string | Request | URL, init?: BunFetchRequestInit | undefined): Promise', gave the following error.\nType 'SharedArrayBuffer' is not assignable to type 'BodyInit | null | undefined'.\nType 'SharedArrayBuffer' is missing the following properties from type 'ArrayBuffer': resizable, resize, detached, transfer, transferToFixedLength\nOverload 3 of 3, '(input: RequestInfo | URL, init?: RequestInit | undefined): Promise', gave the following error.\nType 'SharedArrayBuffer' is not assignable to type 'BodyInit | null | undefined'.\nType 'SharedArrayBuffer' is missing the following properties from type 'ArrayBuffer': resizable, resize, detached, transfer, transferToFixedLength", - }, - { - code: 2353, - line: "globals.ts:307:5", - message: "Object literal may only specify known properties, and 'headers' does not exist in type 'string[]'.", - }, - { - code: 2345, - line: "http.ts:43:24", - message: - "Argument of type '() => AsyncGenerator | \"hey\", void, unknown>' is not assignable to parameter of type 'BodyInit | null | undefined'.", - }, - { - code: 2345, - line: "http.ts:55:24", - message: - "Argument of type 'AsyncGenerator | \"it works!\", void, unknown>' is not assignable to parameter of type 'BodyInit | null | undefined'.\nType 'AsyncGenerator | \"it works!\", void, unknown>' is missing the following properties from type 'ReadableStream': locked, cancel, getReader, pipeThrough, and 3 more.", - }, - { - code: 2345, - line: "index.ts:196:14", - message: - "Argument of type 'AsyncGenerator, void, unknown>' is not assignable to parameter of type 'BodyInit | null | undefined'.\nType 'AsyncGenerator, void, unknown>' is missing the following properties from type 'ReadableStream': locked, cancel, getReader, pipeThrough, and 3 more.", - }, - { - code: 2345, - line: "index.ts:322:29", - message: - "Argument of type '{ headers: { \"x-bun\": string; }; }' is not assignable to parameter of type 'number'.", - }, - { - code: 2339, - line: "spawn.ts:62:38", - message: "Property 'text' does not exist on type 'ReadableStream>'.", - }, - { - code: 2339, - line: "spawn.ts:107:38", - message: "Property 'text' does not exist on type 'ReadableStream>'.", - }, - { - "code": 2769, - "line": "streams.ts:18:3", - "message": - "No overload matches this call.\nOverload 1 of 3, '(underlyingSource: UnderlyingByteSource, strategy?: { highWaterMark?: number | undefined; } | undefined): ReadableStream>', gave the following error.\nType '\"direct\"' is not assignable to type '\"bytes\"'.", - }, - { - "code": 2339, - "line": "streams.ts:20:16", - "message": "Property 'write' does not exist on type 'ReadableByteStreamController'.", - }, - { - "code": 2339, - "line": "streams.ts:46:19", - "message": "Property 'json' does not exist on type 'ReadableStream>'.", - }, - { - "code": 2339, - "line": "streams.ts:47:19", - "message": "Property 'bytes' does not exist on type 'ReadableStream>'.", - }, - { - "code": 2339, - "line": "streams.ts:48:19", - "message": "Property 'text' does not exist on type 'ReadableStream>'.", - }, - { - "code": 2339, - "line": "streams.ts:49:19", - "message": "Property 'blob' does not exist on type 'ReadableStream>'.", - }, - { - code: 2345, - line: "streams.ts:63:66", - message: "Argument of type '\"brotli\"' is not assignable to parameter of type 'CompressionFormat'.", - }, - { - code: 2345, - line: "streams.ts:63:113", - message: "Argument of type '\"brotli\"' is not assignable to parameter of type 'CompressionFormat'.", - }, - { - code: 2345, - line: "streams.ts:64:66", - message: "Argument of type '\"zstd\"' is not assignable to parameter of type 'CompressionFormat'.", - }, - { - code: 2345, - line: "streams.ts:64:111", - message: "Argument of type '\"zstd\"' is not assignable to parameter of type 'CompressionFormat'.", - }, - { - code: 2353, - line: "websocket.ts:25:5", - message: "Object literal may only specify known properties, and 'protocols' does not exist in type 'string[]'.", - }, - { - code: 2353, - line: "websocket.ts:30:5", - message: "Object literal may only specify known properties, and 'protocol' does not exist in type 'string[]'.", - }, - { - code: 2353, - line: "websocket.ts:35:5", - message: "Object literal may only specify known properties, and 'protocol' does not exist in type 'string[]'.", - }, - { - code: 2353, - line: "websocket.ts:43:5", - message: "Object literal may only specify known properties, and 'headers' does not exist in type 'string[]'.", - }, - { - code: 2353, - line: "websocket.ts:51:5", - message: "Object literal may only specify known properties, and 'protocols' does not exist in type 'string[]'.", - }, - { - code: 2554, - line: "websocket.ts:185:29", - message: "Expected 2 arguments, but got 0.", - }, - { - code: 2551, - line: "websocket.ts:192:17", - message: "Property 'URL' does not exist on type 'WebSocket'. Did you mean 'url'?", - }, - { - code: 2322, - line: "websocket.ts:196:3", - message: "Type '\"nodebuffer\"' is not assignable to type 'BinaryType'.", - }, - { - code: 2339, - line: "websocket.ts:242:6", - message: "Property 'ping' does not exist on type 'WebSocket'.", - }, - { - code: 2339, - line: "websocket.ts:245:6", - message: "Property 'ping' does not exist on type 'WebSocket'.", - }, - { - code: 2339, - line: "websocket.ts:249:6", - message: "Property 'ping' does not exist on type 'WebSocket'.", - }, - { - code: 2339, - line: "websocket.ts:253:6", - message: "Property 'ping' does not exist on type 'WebSocket'.", - }, - { - code: 2339, - line: "websocket.ts:256:6", - message: "Property 'pong' does not exist on type 'WebSocket'.", - }, - { - code: 2339, - line: "websocket.ts:259:6", - message: "Property 'pong' does not exist on type 'WebSocket'.", - }, - { - code: 2339, - line: "websocket.ts:263:6", - message: "Property 'pong' does not exist on type 'WebSocket'.", - }, - { - code: 2339, - line: "websocket.ts:267:6", - message: "Property 'pong' does not exist on type 'WebSocket'.", - }, - { - code: 2339, - line: "websocket.ts:270:6", - message: "Property 'terminate' does not exist on type 'WebSocket'.", - }, - { - code: 2339, - line: "worker.ts:23:11", - message: "Property 'ref' does not exist on type 'Worker'.", - }, - { - code: 2339, - line: "worker.ts:24:11", - message: "Property 'unref' does not exist on type 'Worker'.", - }, - { - code: 2339, - line: "worker.ts:25:11", - message: "Property 'threadId' does not exist on type 'Worker'.", - }, - ]); }); });