Skip to content

chore: wip

chore: wip #65

Triggered via push October 20, 2024 18:29
Status Failure
Total duration 26s
Artifacts

ci.yml

on: push
Fit to window
Zoom out
Zoom in

Annotations

11 errors
error: expect(received).toBe(expected): test/dts.test.ts#L31
Expected: "/**\n * Example of const declaration\n */\nexport declare const config: { [key: string]: string }\n\n/**\n * Example of interface declaration\n */\nexport interface User {\n id: number\n name: string\n email: string\n}\n\n/**\n * Example of type declaration\n */\nexport interface ResponseData {\n success: boolean\n data: User[]\n}\n\n/**\n * Example of function declaration\n */\nexport declare function fetchUsers(): Promise<ResponseData>\n" Received: "/**\n * Example of const declaration\n */\nexport const config: { [key: string]: string }\n\n/**\n * Example of interface declaration\n */\nexport interface User {\n id: number\n name: string\n email: string\n}\n\n/**\n * Example of type declaration\n */\nexport interface ResponseData {\n success: boolean\n data: User[]\n}\n\n/**\n * Example of function declaration\n */\nexport declare function fetchUsers(): Promise<ResponseData>\n" at /home/runner/work/dtsx/dtsx/test/dts.test.ts:31:30
error: expect(received).toBe(expected): test/dts.test.ts#L52
Expected: "/**\n * Example of another const declaration\n */\nexport declare const settings: { [key: string]: any }\n\nexport interface Product {\n id: number\n name: string\n price: number\n}\n\nexport interface ApiResponse<T> {\n status: number\n message: string\n data: T\n}\n\n/**\n * Example of function declaration\n */\nexport declare function getProduct(id: number): Promise<ApiResponse<Product>>\n" Received: "/**\n * Example of another const declaration\n */\nexport const settings: { [key: string]: any }\n\nexport interface Product {\n id: number\n name: string\n price: number\n}\n\nexport interface ApiResponse<T> {\n status: number\n message: string\n data: T\n}\n\n/**\n * Example of function declaration\n */\nexport declare function getProduct(id: number): Promise<ApiResponse<Product>>\n" at /home/runner/work/dtsx/dtsx/test/dts.test.ts:52:30
error: expect(received).toBe(expected): test/dts.test.ts#L73
Expected: "export declare const endpoints: {\n getUsers: '/users'\n getProducts: '/products'\n}\n\nexport interface Order {\n orderId: number\n userId: number\n productIds: number[]\n}\n\nexport interface OrderResponse {\n success: boolean\n order: Order\n}\n\n/**\n * Example of function declaration\n */\nexport declare function createOrder(order: Order): Promise<OrderResponse>\n" Received: "export const endpoints = {\n getUsers: '/users',\n getProducts: '/products',\n}\n\nexport interface Order {\n orderId: number\n userId: number\n productIds: number[]\n}\n\nexport interface OrderResponse {\n success: boolean\n order: Order\n}\n" at /home/runner/work/dtsx/dtsx/test/dts.test.ts:73:30
error: expect(received).toBe(expected): test/dts.test.ts#L94
Expected: "export declare const apiKeys: {\n google: 'GOOGLE_API_KEY',\n facebook: 'FACEBOOK_API_KEY',\n}\n\nexport interface AuthResponse {\n token: string\n expiresIn: number\n}\n\nexport type AuthStatus = 'authenticated' | 'unauthenticated'\n\nexport declare function authenticate(user: string, password: string): Promise<AuthResponse>\n" Received: "export const apiKeys = {\n google: 'GOOGLE_API_KEY',\n facebook: 'FACEBOOK_API_KEY',\n}\n\nexport interface AuthResponse {\n token: string\n expiresIn: number\n}\n\nexport type AuthStatus = 'authenticated' | 'unauthenticated'\n\nexport function authenticate(user: string, password: string): Promise<AuthResponse> {\n return fetch('/auth/login', {\n method: 'POST',\n body: JSON.stringify({ user, password }\n" at /home/runner/work/dtsx/dtsx/test/dts.test.ts:94:30
error: expect(received).toBe(expected): test/dts.test.ts#L115
Expected: "export declare const defaultHeaders: {\n 'Content-Type': 'application/json',\n}\n\nexport interface Comment {\n id: number\n postId: number\n body: string\n}\n\nexport interface CommentsResponse {\n comments: Comment[]\n}\n\nexport declare function fetchComments(postId: number): Promise<CommentsResponse>\n" Received: "export const defaultHeaders = {\n 'Content-Type': 'application/json',\n}\n\nexport interface Comment {\n id: number\n postId: number\n body: string\n}\n\nexport interface CommentsResponse {\n comments: Comment[]\n}\n\nexport declare function fetchComments(postId: number): Promise<CommentsResponse>\n" at /home/runner/work/dtsx/dtsx/test/dts.test.ts:115:30
error: expect(received).toBe(expected): test/dts.test.ts#L157
Expected: "import type { DtsGenerationConfig } from '@stacksjs/dtsx'\n\ninterface Options<T> {\n name: string\n cwd?: string\n defaultConfig: T\n}\n\nexport declare function loadConfig<T extends Record<string, unknown>>({ name, cwd, defaultConfig }: Options<T>): Promise<T>\n\nexport declare const config: DtsGenerationConfig\n" Received: "import type { DtsGenerationConfig } from '@stacksjs/dtsx'\nimport { existsSync } from 'node:fs'\nimport { resolve } from 'node:path'\nimport { deepMerge } from '@stacksjs/dtsx'\n\nexport declare const config: DtsGenerationConfig\n" at /home/runner/work/dtsx/dtsx/test/dts.test.ts:157:30
error: expect(received).toBe(expected): test/dts.test.ts#L178
Expected: "import type { DtsGenerationConfig, DtsGenerationOption } from './types'\n\nexport declare function generateDeclarationsFromFiles(options?: DtsGenerationConfig): Promise<void>\n\nexport declare function generate(options?: DtsGenerationOption): Promise<void>\n" Received: "import type { DtsGenerationConfig, DtsGenerationOption } from './types'\nimport { mkdir, rm } from 'node:fs/promises'\nimport { dirname, join, parse, relative } from 'node:path'\nimport { glob } from 'tinyglobby'\nimport { config } from './config'\nimport { extractTypeFromSource } from './extract'\nimport { checkIsolatedDeclarations, getAllTypeScriptFiles, writeToFile } from './utils'\n" at /home/runner/work/dtsx/dtsx/test/dts.test.ts:178:30
error: expect(received).toBe(expected): test/dts.test.ts#L199
Expected: "export { config } from './config'\nexport * from './extract'\nexport * from './generate'\nexport * from './types'\nexport * from './utils'\n" Received: "export { config } from './config'\n" at /home/runner/work/dtsx/dtsx/test/dts.test.ts:199:30
error: expect(received).toBe(expected): test/dts.test.ts#L220
Expected: "/**\n * DtsGenerationConfig\n *\n * This is the configuration object for the DTS generation process.\n */\nexport interface DtsGenerationConfig {\n cwd: string\n root: string\n entrypoints: string[]\n outdir: string\n keepComments: boolean\n clean: boolean\n tsconfigPath: string\n}\n\n/**\n * DtsGenerationOption\n *\n * This is the configuration object for the DTS generation process.\n */\nexport type DtsGenerationOption = Partial<DtsGenerationConfig>\n\n/**\n * DtsGenerationOptions\n *\n * This is the configuration object for the DTS generation process.\n */\nexport type DtsGenerationOptions = DtsGenerationOption | DtsGenerationOption[]\n" Received: "/**\n * DtsGenerationConfig\n *\n * This is the configuration object for the DTS generation process.\n */\nexport interface DtsGenerationConfig {\n cwd: string\n root: string\n entrypoints: string[]\n outdir: string\n keepComments: boolean\n clean: boolean\n tsconfigPath: string\n}\n" at /home/runner/work/dtsx/dtsx/test/dts.test.ts:220:30
error: expect(received).toBe(expected): test/dts.test.ts#L241
Expected: "import type { DtsGenerationConfig } from './types'\n\nexport declare function writeToFile(filePath: string, content: string): Promise<void>\n\nexport declare function getAllTypeScriptFiles(directory?: string): Promise<string[]>\n\nexport declare function checkIsolatedDeclarations(options?: DtsGenerationConfig): Promise<boolean>\n\nexport declare function formatDeclarations(declarations: string): string\n\nexport declare function formatComment(comment: string): string\n\nexport declare function deepMerge<T extends object>(target: T, ...sources: Array<Partial<T>>): T\n" Received: "import { join } from 'node:path'\n\nexport declare function formatDeclarations(declarations: string): string\n\nexport declare function formatComment(comment: string): string\n\nexport function deepMerge<T extends object>(target: T, ...sources: Array<Partial<T>>): T {\n if (!sources.length)\n return target\n\n const source = sources.shift()\n\n if (isObject(target) && isObject(source)) {\n for (const key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n const sourceValue = source[key]\n if (isObject(sourceValue) && isObject(target[key])) {\n target[key] = deepMerge(target[key] as any, sourceValue as any)\n }\n" at /home/runner/work/dtsx/dtsx/test/dts.test.ts:241:30
lint
Process completed with exit code 1.