diff --git a/.chronus/changes/deprecate-old-testing-framework-2026-6-11.md b/.chronus/changes/deprecate-old-testing-framework-2026-6-11.md new file mode 100644 index 00000000000..3e41a64840a --- /dev/null +++ b/.chronus/changes/deprecate-old-testing-framework-2026-6-11.md @@ -0,0 +1,23 @@ +--- +changeKind: deprecation +packages: + - "@typespec/compiler" + - "@typespec/http" + - "@typespec/rest" + - "@typespec/versioning" + - "@typespec/json-schema" + - "@typespec/xml" + - "@typespec/events" + - "@typespec/sse" + - "@typespec/streams" + - "@typespec/html-program-viewer" + - "@typespec/library-linter" + - "@typespec/emitter-framework" + - "@typespec/http-client-js" + - "@typespec/http-client" + - "@typespec/http-server-js" + - "@typespec/openapi" + - "@typespec/openapi3" +--- + +Deprecate old testing framework (`createTestHost`, `createTestRunner`, `createTestWrapper`, `createTestLibrary`, `BasicTestRunner`, `TypeSpecTestLibrary`, etc.). Use `createTester` from `@typespec/compiler/testing` instead. diff --git a/packages/compiler/src/testing/code-fix-testing.ts b/packages/compiler/src/testing/code-fix-testing.ts index c8bd7bdd4ec..a7d294bd3cb 100644 --- a/packages/compiler/src/testing/code-fix-testing.ts +++ b/packages/compiler/src/testing/code-fix-testing.ts @@ -48,6 +48,7 @@ export function expectCodeFixOnAst(code: string, callback: (node: Node) => CodeF const node = getNodeAtPosition(script, pos); ok(node, "Expected node at cursor. Make sure to have ┆ to mark which node."); const codefix = callback(node); + // eslint-disable-next-line @typescript-eslint/no-deprecated const host = await createTestHost(); let updatedContent: string | undefined; await applyCodeFix( @@ -90,6 +91,7 @@ export function expectCodeFixesOnAst( } ok(diagnostics.length > 0, "Expected node at cursor. Make sure to have ┆ to mark which node."); const codeFixes = callback(diagnostics); + // eslint-disable-next-line @typescript-eslint/no-deprecated const host = await createTestHost(); let updatedContent: string | undefined; await applyCodeFixes( diff --git a/packages/compiler/src/testing/fs.ts b/packages/compiler/src/testing/fs.ts index 73a4c6f3bfb..42b83e2302b 100644 --- a/packages/compiler/src/testing/fs.ts +++ b/packages/compiler/src/testing/fs.ts @@ -123,6 +123,7 @@ function createTestFileSystemInternal( jsImports.set(key, exports); } + // eslint-disable-next-line @typescript-eslint/no-deprecated async function addTypeSpecLibrary(testLibrary: TypeSpecTestLibrary) { assertNotFrozen(); diff --git a/packages/compiler/src/testing/index.ts b/packages/compiler/src/testing/index.ts index fc701e6279d..76259c62657 100644 --- a/packages/compiler/src/testing/index.ts +++ b/packages/compiler/src/testing/index.ts @@ -15,6 +15,7 @@ export { } from "./rule-tester.js"; export { extractCursor, extractSquiggles } from "./source-utils.js"; export type { TestHostOptions } from "./test-compiler-host.js"; +/* eslint-disable @typescript-eslint/no-deprecated -- exporting deprecated APIs for backward compatibility */ export { createTestHost, createTestRunner, findFilesFromPattern } from "./test-host.js"; export { createTestLibrary, @@ -25,9 +26,9 @@ export { trimBlankLines, type TestWrapperOptions, } from "./test-utils.js"; +/* eslint-enable @typescript-eslint/no-deprecated */ export { createTester } from "./tester.js"; export type { - BasicTestRunner, EmitterTester, EmitterTesterInstance, JsFile, @@ -36,12 +37,17 @@ export type { TestCompileResult, TestEmitterCompileResult, TestFileSystem as TestFileSystem, + Tester, + TesterInstance, +} from "./types.js"; +/* eslint-disable @typescript-eslint/no-deprecated -- exporting deprecated APIs for backward compatibility */ +export type { + BasicTestRunner, TestFiles, TestHost, TestHostConfig, TestHostError, - Tester, - TesterInstance, TypeSpecTestLibrary, TypeSpecTestLibraryInit, } from "./types.js"; +/* eslint-enable @typescript-eslint/no-deprecated */ diff --git a/packages/compiler/src/testing/rule-tester.ts b/packages/compiler/src/testing/rule-tester.ts index 82061c6adb5..7fe8510ffb8 100644 --- a/packages/compiler/src/testing/rule-tester.ts +++ b/packages/compiler/src/testing/rule-tester.ts @@ -69,6 +69,7 @@ export interface ApplyCodeFixExpect { } export function createLinterRuleTester( + // eslint-disable-next-line @typescript-eslint/no-deprecated runner: BasicTestRunner | TesterInstance, ruleDef: LinterRuleDefinition, libraryName: string, @@ -221,6 +222,7 @@ export function createLinterRuleTester( } } +// eslint-disable-next-line @typescript-eslint/no-deprecated function isLegacyTestRunner(tester: BasicTestRunner | TesterInstance): tester is BasicTestRunner { return "autoCodeOffset" in tester; } diff --git a/packages/compiler/src/testing/test-compiler-host.ts b/packages/compiler/src/testing/test-compiler-host.ts index 62b7891af39..ca57a34e836 100644 --- a/packages/compiler/src/testing/test-compiler-host.ts +++ b/packages/compiler/src/testing/test-compiler-host.ts @@ -6,6 +6,7 @@ import { CompilerHost, StringLiteral, Type } from "../core/types.js"; import { resolveVirtualPath } from "./fs.js"; import { TestFileSystem, TestHostError, TypeSpecTestLibrary } from "./types.js"; +// eslint-disable-next-line @typescript-eslint/no-deprecated export const StandardTestLibrary: TypeSpecTestLibrary = { name: "@typespec/compiler", packageRoot: CompilerPackageRoot, @@ -44,6 +45,7 @@ export function createTestCompilerHost( async readUrl(url: string) { const contents = virtualFs.get(url); if (contents === undefined) { + // eslint-disable-next-line @typescript-eslint/no-deprecated throw new TestHostError(`File ${url} not found.`, "ENOENT"); } return createSourceFile(contents, url); @@ -52,6 +54,7 @@ export function createTestCompilerHost( path = resolveVirtualPath(path); const contents = virtualFs.get(path); if (contents === undefined) { + // eslint-disable-next-line @typescript-eslint/no-deprecated throw new TestHostError(`File ${path} not found.`, "ENOENT"); } return createSourceFile(contents, path); @@ -100,6 +103,7 @@ export function createTestCompilerHost( path = resolveVirtualPath(path); const module = jsImports.get(path); if (module === undefined) { + // eslint-disable-next-line @typescript-eslint/no-deprecated throw new TestHostError(`Module ${path} not found`, "ERR_MODULE_NOT_FOUND"); } return module; @@ -132,6 +136,7 @@ export function createTestCompilerHost( } } + // eslint-disable-next-line @typescript-eslint/no-deprecated throw new TestHostError(`File ${path} not found`, "ENOENT"); }, diff --git a/packages/compiler/src/testing/test-host.ts b/packages/compiler/src/testing/test-host.ts index 68ec16f523a..be03e4c291d 100644 --- a/packages/compiler/src/testing/test-host.ts +++ b/packages/compiler/src/testing/test-host.ts @@ -11,7 +11,8 @@ import { addTestLib, StandardTestLibrary } from "./test-compiler-host.js"; import { createTestWrapper, resolveVirtualPath } from "./test-utils.js"; import { BasicTestRunner, TestHost, TestHostConfig, TypeSpecTestLibrary } from "./types.js"; -/** Use {@link createTester} */ +/* eslint-disable @typescript-eslint/no-deprecated -- implementing deprecated APIs for backward compatibility */ +/** @deprecated Use {@link createTester} */ export async function createTestHost(config: TestHostConfig = {}): Promise { const testHost = await createTestHostInternal(); await testHost.addTypeSpecLibrary(StandardTestLibrary); @@ -23,7 +24,7 @@ export async function createTestHost(config: TestHostConfig = {}): Promise { const testHost = host ?? (await createTestHost()); return createTestWrapper(testHost); @@ -80,6 +81,7 @@ async function createTestHostInternal(): Promise { return [testTypes, p.diagnostics]; } } +/* eslint-enable @typescript-eslint/no-deprecated */ export async function findFilesFromPattern(directory: string, pattern: string): Promise { const results: string[] = []; diff --git a/packages/compiler/src/testing/test-utils.ts b/packages/compiler/src/testing/test-utils.ts index 6b34d559b97..57dc3d4633c 100644 --- a/packages/compiler/src/testing/test-utils.ts +++ b/packages/compiler/src/testing/test-utils.ts @@ -21,7 +21,9 @@ export function resolveVirtualPath(path: string, ...paths: string[]) { return resolvePath(rootDir, path, ...paths); } -/** Find the package root from the provided file */ +/** Find the package root from the provided file + * @deprecated Use {@link createTester} instead + */ export function findTestPackageRoot(fileUrl: string): Promise { return findProjectRoot(NodeHost.stat, fileURLToPath(fileUrl)) as Promise; } @@ -29,7 +31,9 @@ export function findTestPackageRoot(fileUrl: string): Promise { * Define a test library defaulting to the most common library structure. * @param init Library configuration. * @returns TypeSpec Test library. + * @deprecated Use {@link createTester} instead */ +// eslint-disable-next-line @typescript-eslint/no-deprecated export function createTestLibrary(init: TypeSpecTestLibraryInit): TypeSpecTestLibrary { const { name } = init; const typespecFileFolder = init.typespecFileFolder ?? "lib"; @@ -53,6 +57,7 @@ export function createTestLibrary(init: TypeSpecTestLibraryInit): TypeSpecTestLi }; } +/** @deprecated Use {@link Tester} instead */ export interface TestWrapperOptions { wrapper?: (code: string) => string; @@ -68,6 +73,8 @@ export interface TestWrapperOptions { compilerOptions?: CompilerOptions; } +/** @deprecated Use {@link createTester} instead */ +/* eslint-disable @typescript-eslint/no-deprecated -- implementing deprecated API for backward compatibility */ export function createTestWrapper( host: TestHost, testWrapperOptions: TestWrapperOptions = {}, @@ -111,6 +118,7 @@ export function createTestWrapper( }, }; } +/* eslint-enable @typescript-eslint/no-deprecated */ export function trimBlankLines(code: string) { let start = 0; diff --git a/packages/compiler/src/testing/types.ts b/packages/compiler/src/testing/types.ts index 19e47db94f4..c8895255e9c 100644 --- a/packages/compiler/src/testing/types.ts +++ b/packages/compiler/src/testing/types.ts @@ -38,6 +38,7 @@ export interface TestFileSystem { addRealTypeSpecFile(path: string, realPath: string): Promise; addRealJsFile(path: string, realPath: string): Promise; addRealFolder(path: string, realPath: string): Promise; + // eslint-disable-next-line @typescript-eslint/no-deprecated addTypeSpecLibrary(testLibrary: TypeSpecTestLibrary): Promise; /** @internal */ @@ -220,6 +221,8 @@ export interface PositionedMarkerInFile extends PositionedMarker { // #endregion // #region Legacy Test host +/* eslint-disable @typescript-eslint/no-deprecated -- defining deprecated APIs for backward compatibility */ +/** @deprecated Use {@link Tester} */ export interface TestHost extends Pick< TestFileSystem, | "addTypeSpecFile" @@ -243,12 +246,14 @@ export interface TestHost extends Pick< ): Promise<[Record, readonly Diagnostic[]]>; } +/** @deprecated Use {@link Tester} */ export interface TestFiles { realDir: string; pattern: string; virtualPath: string; } +/** @deprecated Use {@link Tester} */ export interface TypeSpecTestLibraryInit { name: string; packageRoot: string; @@ -263,16 +268,19 @@ export interface TypeSpecTestLibraryInit { jsFileFolder?: string; } +/** @deprecated Use {@link Tester} */ export interface TypeSpecTestLibrary { name: string; packageRoot: string; files: TestFiles[]; } +/** @deprecated Use {@link Tester} */ export interface TestHostConfig { libraries?: TypeSpecTestLibrary[]; } +/** @deprecated Use {@link Tester} */ export class TestHostError extends Error { constructor( message: string, @@ -282,6 +290,7 @@ export class TestHostError extends Error { } } +/** @deprecated Use {@link TesterInstance} */ export interface BasicTestRunner { readonly program: Program; readonly fs: Map; @@ -309,4 +318,5 @@ export interface BasicTestRunner { options?: CompilerOptions, ): Promise<[Record, readonly Diagnostic[]]>; } +/* eslint-enable @typescript-eslint/no-deprecated */ // #endregion diff --git a/packages/compiler/templates/__snapshots__/emitter-ts/src/testing/index.ts b/packages/compiler/templates/__snapshots__/emitter-ts/src/testing/index.ts deleted file mode 100644 index 2232aeb74fc..00000000000 --- a/packages/compiler/templates/__snapshots__/emitter-ts/src/testing/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { resolvePath } from "@typespec/compiler"; -import { createTestLibrary, TypeSpecTestLibrary } from "@typespec/compiler/testing"; -import { fileURLToPath } from "url"; - -export const EmitterTsTestLibrary: TypeSpecTestLibrary = createTestLibrary({ - name: "emitter-ts", - packageRoot: resolvePath(fileURLToPath(import.meta.url), "../../../../"), -}); diff --git a/packages/compiler/templates/__snapshots__/library-ts/src/testing/index.ts b/packages/compiler/templates/__snapshots__/library-ts/src/testing/index.ts deleted file mode 100644 index 98f124f62a8..00000000000 --- a/packages/compiler/templates/__snapshots__/library-ts/src/testing/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { resolvePath } from "@typespec/compiler"; -import { createTestLibrary, TypeSpecTestLibrary } from "@typespec/compiler/testing"; -import { fileURLToPath } from "url"; - -export const LibraryTsTestLibrary: TypeSpecTestLibrary = createTestLibrary({ - name: "library-ts", - packageRoot: resolvePath(fileURLToPath(import.meta.url), "../../../../"), -}); diff --git a/packages/compiler/templates/emitter-ts/src/testing/index.ts.mu b/packages/compiler/templates/emitter-ts/src/testing/index.ts.mu deleted file mode 100644 index cd1a7daa546..00000000000 --- a/packages/compiler/templates/emitter-ts/src/testing/index.ts.mu +++ /dev/null @@ -1,8 +0,0 @@ -import { resolvePath } from "@typespec/compiler"; -import { createTestLibrary, TypeSpecTestLibrary } from "@typespec/compiler/testing"; -import { fileURLToPath } from "url"; - -export const {{#casing.pascalCase}}{{name}}{{/casing.pascalCase}}TestLibrary: TypeSpecTestLibrary = createTestLibrary({ - name: "{{name}}", - packageRoot: resolvePath(fileURLToPath(import.meta.url), "../../../../"), -}); diff --git a/packages/compiler/templates/library-ts/src/testing/index.ts.mu b/packages/compiler/templates/library-ts/src/testing/index.ts.mu deleted file mode 100644 index cd1a7daa546..00000000000 --- a/packages/compiler/templates/library-ts/src/testing/index.ts.mu +++ /dev/null @@ -1,8 +0,0 @@ -import { resolvePath } from "@typespec/compiler"; -import { createTestLibrary, TypeSpecTestLibrary } from "@typespec/compiler/testing"; -import { fileURLToPath } from "url"; - -export const {{#casing.pascalCase}}{{name}}{{/casing.pascalCase}}TestLibrary: TypeSpecTestLibrary = createTestLibrary({ - name: "{{name}}", - packageRoot: resolvePath(fileURLToPath(import.meta.url), "../../../../"), -}); diff --git a/packages/compiler/templates/scaffolding.json b/packages/compiler/templates/scaffolding.json index 152f071f8f6..08823490a52 100644 --- a/packages/compiler/templates/scaffolding.json +++ b/packages/compiler/templates/scaffolding.json @@ -124,10 +124,6 @@ "path": "library-ts/src/rules/no-interfaces.rule.ts", "destination": "src/rules/no-interfaces.rule.ts" }, - { - "path": "library-ts/src/testing/index.ts.mu", - "destination": "src/testing/index.ts" - }, { "path": "library-ts/test/decorators.test.ts.mu", "destination": "test/decorators.test.ts" @@ -185,10 +181,6 @@ "path": "emitter-ts/src/lib.ts", "destination": "src/lib.ts" }, - { - "path": "emitter-ts/src/testing/index.ts.mu", - "destination": "src/testing/index.ts" - }, { "path": "emitter-ts/test/hello.test.ts", "destination": "test/hello.test.ts" diff --git a/packages/emitter-framework/src/testing/index.ts b/packages/emitter-framework/src/testing/index.ts index 36a7e71dff4..43822ba4096 100644 --- a/packages/emitter-framework/src/testing/index.ts +++ b/packages/emitter-framework/src/testing/index.ts @@ -2,6 +2,7 @@ import { resolvePath } from "@typespec/compiler"; import { createTestLibrary, type TypeSpecTestLibrary } from "@typespec/compiler/testing"; import { fileURLToPath } from "url"; +/** @deprecated Use `createTester` from `@typespec/compiler/testing` instead */ export const EmitterFrameworkTestLibrary: TypeSpecTestLibrary = createTestLibrary({ name: "@typespec/emitter-framework", packageRoot: resolvePath(fileURLToPath(import.meta.url), "../../../"), diff --git a/packages/events/src/testing/index.ts b/packages/events/src/testing/index.ts index 66ba1a1bc01..882567e800b 100644 --- a/packages/events/src/testing/index.ts +++ b/packages/events/src/testing/index.ts @@ -1,6 +1,9 @@ import { createTestLibrary, findTestPackageRoot } from "@typespec/compiler/testing"; +/** @deprecated Use `createTester` from `@typespec/compiler/testing` instead */ +/* eslint-disable @typescript-eslint/no-deprecated */ export const EventsTestLibrary = createTestLibrary({ name: "@typespec/events", packageRoot: await findTestPackageRoot(import.meta.url), }); +/* eslint-enable @typescript-eslint/no-deprecated */ diff --git a/packages/html-program-viewer/src/testing/index.ts b/packages/html-program-viewer/src/testing/index.ts index 3054fa4f14e..cd259a8f62b 100644 --- a/packages/html-program-viewer/src/testing/index.ts +++ b/packages/html-program-viewer/src/testing/index.ts @@ -4,8 +4,11 @@ import { type TypeSpecTestLibrary, } from "@typespec/compiler/testing"; +/** @deprecated Use `createTester` from `@typespec/compiler/testing` instead */ +/* eslint-disable @typescript-eslint/no-deprecated */ export const ProgramViewerTestLibrary: TypeSpecTestLibrary = createTestLibrary({ name: "@typespec/html-program-viewer", jsFileFolder: "dist/emitter", packageRoot: await findTestPackageRoot(import.meta.url), }); +/* eslint-enable @typescript-eslint/no-deprecated */ diff --git a/packages/http-client-js/src/testing/index.ts b/packages/http-client-js/src/testing/index.ts index 5148a1bba17..a9a1fc2dcc9 100644 --- a/packages/http-client-js/src/testing/index.ts +++ b/packages/http-client-js/src/testing/index.ts @@ -2,6 +2,7 @@ import { resolvePath } from "@typespec/compiler"; import { createTestLibrary, TypeSpecTestLibrary } from "@typespec/compiler/testing"; import { fileURLToPath } from "url"; +/** @deprecated Use `createTester` from `@typespec/compiler/testing` instead */ export const HttpClientJavascriptEmitterTestLibrary: TypeSpecTestLibrary = createTestLibrary({ name: "@typespec/http-client-js", packageRoot: resolvePath(fileURLToPath(import.meta.url), "../../../"), diff --git a/packages/http-client/src/testing/index.ts b/packages/http-client/src/testing/index.ts index fca24204afe..8cdea7d5c7a 100644 --- a/packages/http-client/src/testing/index.ts +++ b/packages/http-client/src/testing/index.ts @@ -2,6 +2,7 @@ import { resolvePath } from "@typespec/compiler"; import { createTestLibrary, TypeSpecTestLibrary } from "@typespec/compiler/testing"; import { fileURLToPath } from "url"; +/** @deprecated Use `createTester` from `@typespec/compiler/testing` instead */ export const HttpClientTestLibrary: TypeSpecTestLibrary = createTestLibrary({ name: "@typespec/http-client", packageRoot: resolvePath(fileURLToPath(import.meta.url), "../../../../"), diff --git a/packages/http-server-js/src/testing/index.ts b/packages/http-server-js/src/testing/index.ts index 94286cbfc2d..4455fcb04e9 100644 --- a/packages/http-server-js/src/testing/index.ts +++ b/packages/http-server-js/src/testing/index.ts @@ -4,7 +4,10 @@ import { findTestPackageRoot, } from "@typespec/compiler/testing"; +/** @deprecated Use `createTester` from `@typespec/compiler/testing` instead */ +/* eslint-disable @typescript-eslint/no-deprecated */ export const HttpServerJavaScriptTestLibrary: TypeSpecTestLibrary = createTestLibrary({ name: "@typespec/http-server-js", packageRoot: await findTestPackageRoot(import.meta.url), }); +/* eslint-enable @typescript-eslint/no-deprecated */ diff --git a/packages/http/src/testing/index.ts b/packages/http/src/testing/index.ts index 9c1a1d327c7..d792b4931cf 100644 --- a/packages/http/src/testing/index.ts +++ b/packages/http/src/testing/index.ts @@ -4,7 +4,10 @@ import { TypeSpecTestLibrary, } from "@typespec/compiler/testing"; +/** @deprecated Use `createTester` from `@typespec/compiler/testing` instead */ +/* eslint-disable @typescript-eslint/no-deprecated */ export const HttpTestLibrary: TypeSpecTestLibrary = createTestLibrary({ name: "@typespec/http", packageRoot: await findTestPackageRoot(import.meta.url), }); +/* eslint-enable @typescript-eslint/no-deprecated */ diff --git a/packages/json-schema/src/testing/index.ts b/packages/json-schema/src/testing/index.ts index 78267d60957..eeac8165fd5 100644 --- a/packages/json-schema/src/testing/index.ts +++ b/packages/json-schema/src/testing/index.ts @@ -4,7 +4,10 @@ import { type TypeSpecTestLibrary, } from "@typespec/compiler/testing"; +/** @deprecated Use `createTester` from `@typespec/compiler/testing` instead */ +/* eslint-disable @typescript-eslint/no-deprecated */ export const JsonSchemaTestLibrary: TypeSpecTestLibrary = createTestLibrary({ name: "@typespec/json-schema", packageRoot: await findTestPackageRoot(import.meta.url), }); +/* eslint-enable @typescript-eslint/no-deprecated */ diff --git a/packages/library-linter/src/testing/index.ts b/packages/library-linter/src/testing/index.ts index 15db03ddbda..8ac5f4e8ef6 100644 --- a/packages/library-linter/src/testing/index.ts +++ b/packages/library-linter/src/testing/index.ts @@ -4,7 +4,10 @@ import { TypeSpecTestLibrary, } from "@typespec/compiler/testing"; +/** @deprecated Use `createTester` from `@typespec/compiler/testing` instead */ +/* eslint-disable @typescript-eslint/no-deprecated */ export const LibraryLinterTestLibrary: TypeSpecTestLibrary = createTestLibrary({ name: "@typespec/library-linter", packageRoot: await findTestPackageRoot(import.meta.url), }); +/* eslint-enable @typescript-eslint/no-deprecated */ diff --git a/packages/openapi/src/testing/index.ts b/packages/openapi/src/testing/index.ts index 706829790f7..f86032d85b8 100644 --- a/packages/openapi/src/testing/index.ts +++ b/packages/openapi/src/testing/index.ts @@ -5,7 +5,9 @@ import { } from "@typespec/compiler/testing"; /** @deprecated use new Tester */ +/* eslint-disable @typescript-eslint/no-deprecated */ export const OpenAPITestLibrary: TypeSpecTestLibrary = createTestLibrary({ name: "@typespec/openapi", packageRoot: await findTestPackageRoot(import.meta.url), }); +/* eslint-enable @typescript-eslint/no-deprecated */ diff --git a/packages/openapi3/src/testing/index.ts b/packages/openapi3/src/testing/index.ts index be67df9601c..4b284d4a4e4 100644 --- a/packages/openapi3/src/testing/index.ts +++ b/packages/openapi3/src/testing/index.ts @@ -5,7 +5,9 @@ import { } from "@typespec/compiler/testing"; /** @deprecated use new Tester */ +/* eslint-disable @typescript-eslint/no-deprecated */ export const OpenAPI3TestLibrary: TypeSpecTestLibrary = createTestLibrary({ name: "@typespec/openapi3", packageRoot: await findTestPackageRoot(import.meta.url), }); +/* eslint-enable @typescript-eslint/no-deprecated */ diff --git a/packages/rest/src/testing/index.ts b/packages/rest/src/testing/index.ts index 07fc1e57e28..3a60e13ae9d 100644 --- a/packages/rest/src/testing/index.ts +++ b/packages/rest/src/testing/index.ts @@ -4,7 +4,10 @@ import { TypeSpecTestLibrary, } from "@typespec/compiler/testing"; +/** @deprecated Use `createTester` from `@typespec/compiler/testing` instead */ +/* eslint-disable @typescript-eslint/no-deprecated */ export const RestTestLibrary: TypeSpecTestLibrary = createTestLibrary({ name: "@typespec/rest", packageRoot: await findTestPackageRoot(import.meta.url), }); +/* eslint-enable @typescript-eslint/no-deprecated */ diff --git a/packages/sse/src/testing/index.ts b/packages/sse/src/testing/index.ts index aaced1410b3..dc936549ac1 100644 --- a/packages/sse/src/testing/index.ts +++ b/packages/sse/src/testing/index.ts @@ -1,6 +1,9 @@ import { createTestLibrary, findTestPackageRoot } from "@typespec/compiler/testing"; +/** @deprecated Use `createTester` from `@typespec/compiler/testing` instead */ +/* eslint-disable @typescript-eslint/no-deprecated */ export const SSETestLibrary = createTestLibrary({ name: "@typespec/sse", packageRoot: await findTestPackageRoot(import.meta.url), }); +/* eslint-enable @typescript-eslint/no-deprecated */ diff --git a/packages/streams/src/testing/index.ts b/packages/streams/src/testing/index.ts index 1308ba5390f..3e73af2e820 100644 --- a/packages/streams/src/testing/index.ts +++ b/packages/streams/src/testing/index.ts @@ -1,6 +1,9 @@ import { createTestLibrary, findTestPackageRoot } from "@typespec/compiler/testing"; +/** @deprecated Use `createTester` from `@typespec/compiler/testing` instead */ +/* eslint-disable @typescript-eslint/no-deprecated */ export const StreamsTestLibrary = createTestLibrary({ name: "@typespec/streams", packageRoot: await findTestPackageRoot(import.meta.url), }); +/* eslint-enable @typescript-eslint/no-deprecated */ diff --git a/packages/versioning/src/testing/index.ts b/packages/versioning/src/testing/index.ts index 75fe32643a6..1c1c3ed48bc 100644 --- a/packages/versioning/src/testing/index.ts +++ b/packages/versioning/src/testing/index.ts @@ -4,7 +4,10 @@ import { type TypeSpecTestLibrary, } from "@typespec/compiler/testing"; +/** @deprecated Use `createTester` from `@typespec/compiler/testing` instead */ +/* eslint-disable @typescript-eslint/no-deprecated */ export const VersioningTestLibrary: TypeSpecTestLibrary = createTestLibrary({ name: "@typespec/versioning", packageRoot: await findTestPackageRoot(import.meta.url), }); +/* eslint-enable @typescript-eslint/no-deprecated */ diff --git a/packages/xml/src/testing/index.ts b/packages/xml/src/testing/index.ts index 6f4e37bebb8..53cc42405f6 100644 --- a/packages/xml/src/testing/index.ts +++ b/packages/xml/src/testing/index.ts @@ -4,7 +4,10 @@ import { type TypeSpecTestLibrary, } from "@typespec/compiler/testing"; +/** @deprecated Use `createTester` from `@typespec/compiler/testing` instead */ +/* eslint-disable @typescript-eslint/no-deprecated */ export const XmlTestLibrary: TypeSpecTestLibrary = createTestLibrary({ name: "@typespec/xml", packageRoot: await findTestPackageRoot(import.meta.url), }); +/* eslint-enable @typescript-eslint/no-deprecated */