Skip to content

Instantly share code, notes, and snippets.

@nightcycle
Last active September 2, 2023 21:17
Show Gist options
  • Save nightcycle/50ca8f42147077b8f584b503030c8500 to your computer and use it in GitHub Desktop.
Save nightcycle/50ca8f42147077b8f584b503030c8500 to your computer and use it in GitHub Desktop.
luau-lsp type definition file for testEZ (.spec) scripts
export type Expectation = {
to: Expectation,
be: Expectation,
been: Expectation,
have: Expectation,
was: Expectation,
at: Expectation,
a: (typeName: string?) -> Expectation,
an: (typeName: string?) -> Expectation,
ok: () -> Expectation,
throw: (message: string?) -> Expectation,
near: (goal: number, limit: number?) -> Expectation,
equal: (goal: any) -> Expectation,
}
declare function describe(name: string, out: () -> ()): ()
declare function it(name: string, out: () -> ()): ()
declare function expect(value: any): Expectation
declare function afterAll(func: () -> ()): ()
declare function afterEach(func: () -> ()): ()
declare function beforeAll(func: () -> ()): ()
declare function beforeEach(func: () -> ()): ()
declare function FIXME(message: string?): ()
declare function FOCUS(): ()
declare function SKIP(): ()
declare function describeFOCUS(phrase: string): ()
declare function describeSKIP(phrase: string): ()
declare function itFOCUS(phrase: string, callback: ((context: {[any]: any}) -> ())): ()
declare function itSKIP(phrase: string, callback: ((context: {[any]: any}) -> ())): ()
declare function itFIXME(phrase: string, callback: ((context: {[any]: any}) -> ())): ()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment