chore: wip #71
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 someFunction2: Function;\n someArray: [1, 2, 3];\n someNestedArray: [\n [1, 2, 3],\n [4, 5, 6, 7, 8, 9, 10]\n ];\n someComplexArray: [\n [{ key: 'value' }],\n [{ key2: 'value2' }, 'test', 1000],\n ['some string', Function, Function]\n ];\n someObject: { key: 'value' };\n someNestedObject: {\n key: {\n nestedKey: 'value';\n };\n otherKey: {\n nestedKey: Function;\n nestedKey2: Function;\n };\n };\n someNestedObjectArray: [\n { key: 'value' },\n { key2: 'value2' }\n ];\n someOtherObject: unknown;\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 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: { [key: string]: string };\n\nexport declare const someObject: {\n someString: 'Stacks';\n someNumber: 1000;\n someBoolean: true;\n someFalse: false;\n someFunction: () => { console.log('hello world') };\n\n someFunction2: () => {\n // some comment: ;\n /* some other comment */: ;\n return some.object ?? 'default':;\n},:
|
lint
Process completed with exit code 1.
|