chore: wip #79
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';\nimport { generate } from '@stacksjs/dtsx';\n\n/**\n * Example of const declaration\n */\nexport declare const conf: { [key: string]: string };\n\nexport declare const someObject: {\n someString: 'Stacks';\n someNumber: 1000;\n someBoolean: true;\n someFalse: false;\n someFunction: Function;\n anotherOne: Function;\n someArray: Array<any>;\n someNestedArray: Array<Array<number>>;\n someComplexArray: Array<any>;\n someObject: Object;\n someNestedObject: Object;\n someNestedObjectArray: Array<any>;\n someOtherObject: Object;\n someInlineCall2: Function;\n someInlineCall3: Function;\n};\n\n/**\n * Example of interface declaration\n * with another comment in an extra line\n */\nexport declare interface User {\n id: number;\n name: string;\n email: string;\n}\n\n/**\n * Example of type declaration\n *\n * with multiple lines of comments, including an empty line\n */\nexport declare interface ResponseData {\n success: boolean;\n data: User[];\n}\n\n/**\n * Example of function declaration\n *\n *\n * with multiple empty lines, including an empty lines\n */\nexport declare function fetchUsers(): Promise<ResponseData>;\n\nexport declare interface ApiResponse<T> {\n status: number;\n message: string;\n data: T;\n}\n\n/**\n * Example of another const declaration\n *\n* with multiple empty lines, including being poorly formatted\n */\ndeclare const settings: {\n theme: 'dark';\n language: 'en';\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\ndeclare interface 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\ndeclare const dtsConfig: {\n name: 'dts';\n cwd: process.cwd();\n defaultConfig: {\n root: './src';\n entrypoints: ['**/*.ts'];\n outdir: './dist',\n keepComments: true,\n clean: true,\n tsconfigPath: './tsconfig.json',\n },\n root: './src',\n entrypoints: ['**/*.ts'],\n outdir: './dist',\n keepComments: true,\n clean: true,\n tsconfigPath: './tsconfig.json',\n}\n\n// declare const dtsConfig: DtsGenerationConfig;\n\nexport { generate, dtsConfig };\n\nexport type { DtsGenerationOption };\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 type { DtsGenerationConfig, DtsGenerationOption } from '@stacksjs/dtsx'\nimport type { BunPlugin } from 'bun';\n/**\n* Example of const declaration\n*/\nexport declare const conf: conf;\nexport declare const someObject: {\n someString: 'Stacks';\n someNumber: 1000;\n someBoolean: true;\n someFalse: false;\n someFunction: (...args: any[]) => void;\n anotherOne: (...args: any[]) => string;\n someArray: Array<1 | 2 | 3>;\n someNestedArray: Array<1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10>;\n someNestedArray2: Array<1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 'dummy value'>;\n someNestedArray3: Array<1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 'dummy value', [11, 12, 13]'>;\n someOtherNestedArray: Array<'some text', 2, console.log, () => console.log('hello world'), helloWorld'>;\n someComplexArray: Array<Object>;\n someObject: {\n key: 'value';\n };\n someNestedObject: {\n key: {\n nestedKey: 'value';\n };\n otherKey: {\n
|
lint
Process completed with exit code 1.
|