chore: wip #67
Annotations
2 errors
error: expect(received).toBe(expected):
test/dts.test.ts#L31
Expected: "import type { DtsGenerationOption, DtsGenerationConfig } from '@stacksjs/dtsx';\nimport type { BunPlugin } from 'bun';\n\n/**\n * Example of const declaration\n */\nexport declare const conf: {\n apiUrl: 'https://api.stacksjs.org';\n timeout: '5000'; // as string\n};\n\nexport declare const someObject: {\n someString: 'Stacks';\n someNumber: 1000;\n someBoolean: true;\n someFalse: false;\n};\n\n/**\n * Example of interface declaration\n */\nexport declare interface User {\n id: number;\n name: string;\n email: string;\n}\n\n/**\n * Example of type declaration\n */\nexport declare interface ResponseData {\n success: boolean;\n data: User[];\n}\n\n/**\n * Example of function declaration\n */\nexport declare function fetchUsers(): Promise<ResponseData>;\n\nexport declare interface ApiResponse<T> {\n status: number;\n message: string;\n data: T;\n}\n\nexport declare interface Product {\n id: number;\n name: string;\n price: number;\n}\n\n/**\n * Example of function declaration\n */\nexport declare function getProduct(id: number): Promise<ApiResponse<Product>>;\n\nexport declare interface AuthResponse {\n token: string;\n expiresIn: number;\n}\n\nexport declare type AuthStatus = 'authenticated' | 'unauthenticated';\n\nexport declare function authenticate(user: string, password: string): Promise<AuthResponse>;\n\nexport declare const defaultHeaders: {\n 'Content-Type': string;\n};\n\nexport declare function dts(options?: DtsGenerationOption): BunPlugin;\n\ninterface Options<T> {\n name: string;\n cwd?: string;\n defaultConfig: T;\n}\n\nexport declare function loadConfig<T extends Record<string, unknown>>(options: Options<T>): Promise<T>;\n\nexport declare const dtsConfig: DtsGenerationConfig;\n\nexport { generate } from '@stacksjs/dtsx';\n\nexport { config } from './config';\nexport * from './extract';\nexport * from './generate';\nexport * from './types';\nexport * from './utils';\n\nexport default dts;\n"
Received: "import type { BunPlugin } from 'bun'\nimport process from 'node:process'\nimport { generate, deepMerge } from '@stacksjs/dtsx'\nimport type { DtsGenerationConfig, DtsGenerationOption } from '@stacksjs/dtsx'\nimport { existsSync } from 'node:fs'\nimport { resolve } from 'node:path'\n/**\n * Example of const declaration\n */\nexport declare const conf: {\n apiUrl: 'https://api.stacksjs.org';\n timeout: '5000', // as string;\n}\n\nexport declare const someObject: {\n someString: 'Stacks';\n someNumber: 1000;\n someBoolean: true;\n someFalse: false;\n}\n\n/**\n * Example of interface declaration\n */\nexport declare interface User {\n id: number\n name: string\n email: string\n}\n\n/**\n * Example of type declaration\n */\nexport declare interface ResponseData {\n success: boolean\n data: User[]\n}\n\n/**\n * Example of function declaration\n */\nexport declare function function fetchUsers(): Promise<ResponseData>;\nexport declare interface ApiResponse<T> {\n status: number\n message: string\n data: T\n}\n\n/**\n * Example of another const declaration\n */\nexport declare interface Product {\n id: number\n name: string\n price: number\n}\n\n/**\n * Example of function declaration\n */\nexport declare function function getProduct(id: number): number):;\nexport declare interface AuthResponse {\n token: string\n expiresIn: number\n}\n\nexport declare type AuthStatus = \nexport declare function function authenticate(user: string, password: string): string;\nexport declare const defaultHeaders: {\n 'Content-Type': 'application/json';\n}\n\nexport declare function function dts(options?: DtsGenerationOption): DtsGenerationOption):;\nexport declare function function loadConfig<T extends Record<string, unknown>>(): Options<T>):;\nexport { generate, dtsConfig }\n\nexport declare type { DtsGenerationOption } = \nexport { config } from './config'\nexport * from './extract'\nexport * from './generate'\nexport * from './types'\nexport * from './utils'\n\nexport default dts;"
at /home/runner/work/dtsx/dtsx/test/dts.test.ts:31:30
|
lint
Process completed with exit code 1.
|