-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug: Global types are not registered in typescript properly (#95)
fix: global type declarations Fixed TypeScript global declarations for `define`, `expect`, `beforeAll`, and `afterAll` functions. Updated type exports to avoid duplication and ensure proper type resolution in consuming projects. Changes: - Added proper global declarations in index.d.ts - Removed duplicate type exports from index.ts - Fixed build script for type declarations Bump version to 0.0.2 and update changelogs
- Loading branch information
Showing
7 changed files
with
75 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@antiwork:registry=https://registry.npmjs.org/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import type { Expect } from 'expect'; | ||
import type { ShortestGlobals } from './dist/types/globals'; | ||
import type { UITestBuilderInterface } from './dist/types/ui-test-builder'; | ||
import type { TestStep, BeforeAllFunction, AfterAllFunction } from './dist/types/test'; | ||
import type { ShortestConfig } from './dist/types/config'; | ||
|
||
declare global { | ||
const define: (name: string, fn: () => void | Promise<void>) => void; | ||
const expect: Expect; | ||
const __shortest__: ShortestGlobals; | ||
const beforeAll: (fn: () => void | Promise<void>) => void; | ||
const afterAll: (fn: () => void | Promise<void>) => void; | ||
} | ||
|
||
// Export module types | ||
declare module '@antiwork/shortest' { | ||
export type { ShortestConfig }; | ||
|
||
export class UITestBuilder<T = any> implements UITestBuilderInterface<T> { | ||
path: string; | ||
testName: string; | ||
steps: TestStep[]; | ||
|
||
constructor(path: string); | ||
setSuiteName(name: string): this; | ||
getSuiteName(): string; | ||
test(name: string): this; | ||
|
||
given(description: string): this; | ||
given(description: string, callback: () => Promise<void>): this; | ||
given(description: string, payload: T, callback?: () => Promise<void>): this; | ||
|
||
when(description: string): this; | ||
when(description: string, callback: () => Promise<void>): this; | ||
when(description: string, payload: T, callback?: () => Promise<void>): this; | ||
|
||
expect(description: string): this; | ||
expect(description: string, callback: () => Promise<void>): this; | ||
expect(description: string, payload: T, callback?: () => Promise<void>): this; | ||
|
||
before(actionOrFn: string | BeforeAllFunction, payload?: T): this; | ||
after(actionOrFn: string | AfterAllFunction, payload?: T): this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.