-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add deftest type definitions (#81)
Types for deftest by @daysgobye --------- Co-authored-by: Cole Smith <[email protected]>
- Loading branch information
1 parent
f7ef5fb
commit cfe4755
Showing
3 changed files
with
53 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/// <library version="2.8.0" src="https://github.com/britzl/deftest/archive/refs/tags/2.8.0.zip" /> | ||
/// <reference path="./deftest.deftest.d.ts" /> |
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,47 @@ | ||
/** @noSelfInFile **/ | ||
|
||
/** | ||
* Unit testing in Defold | ||
* @see {@link https://github.com/britzl/deftest|Github Source} | ||
* @noResolution | ||
*/ | ||
declare module 'deftest.deftest' { | ||
export function add(...args: ((...args: any[]) => unknown)[]): void; | ||
export function run(options?: { | ||
coverage?: { | ||
enabled?: boolean, | ||
} | ||
pattern?: string, | ||
}): void; | ||
} | ||
|
||
declare function describe(title: string, tests: () => void): void | ||
declare function before(before: () => void): void | ||
declare function after(after: () => void): void | ||
declare function test(title: string, test: () => void): void | ||
declare function assert_equal<T>(a: T, b: T): void | ||
declare function assert_blank(value: any): void | ||
declare function assert_empty(obj: Record<any, any>): void | ||
declare function assert_error(func: any): void | ||
declare function assert_not_error(func: any): void | ||
declare function assert_false(value: boolean): void | ||
declare function assert_not_false(value: boolean): void | ||
declare function assert_not_true(value: boolean): void | ||
declare function assert_true(value: boolean): void | ||
declare function assert_greater_than(a: number, b: number): void | ||
declare function assert_gte(a: number, b: number): void | ||
declare function assert_less_than(a: number, b: number): void | ||
declare function assert_lte(a: number, b: number): void | ||
declare function assert_match(a: number, b: number): void | ||
declare function assert_nil(value: any): void | ||
declare function assert_type<T>(a: T, b: T): void | ||
declare function assert_not_blank(value: any): void | ||
declare function assert_not_empty(value: any): void | ||
declare function assert_not_equal<T>(a: T, b: T): void | ||
declare function assert_not_greater_than(a: number, b: number): void | ||
declare function assert_not_gte(a: number, b: number): void | ||
declare function assert_not_less_than(a: number, b: number): void | ||
declare function assert_not_lte(a: number, b: number): void | ||
declare function assert_not_match(a: number, b: number): void | ||
declare function assert_not_nil(value: any): void | ||
declare function assert_not_type<T>(a: T, b: T): void |
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,4 @@ | ||
{ | ||
"name": "deftest", | ||
"url": "https://github.com/britzl/deftest" | ||
} |