Skip to content

Instantly share code, notes, and snippets.

@villesau
Created March 10, 2018 00:18
Show Gist options
  • Save villesau/3acbd1c7d01b1118c9ef3b307aa209f1 to your computer and use it in GitHub Desktop.
Save villesau/3acbd1c7d01b1118c9ef3b307aa209f1 to your computer and use it in GitHub Desktop.
/**
* TDD language that can used in tests for more descriptive test writing and smaller scopes.
* Note that we don't actually run tests, these are simply present to mimic the TDD verbs we know and love.
*
* Usage:
*
* describe('#someFunction', () => {
* it('should do something', () => {
* // test...
* })
*
* // you can also do type checks outside an it statement
* })
*
* It is set up such that you don't need to import these functions, you can just use them naturally as if they were
* available in the global scope.
*/
declare module 'flow-typed-test' {
declare export function describe(label: string, fn: (...Array<any>) => any): void;
declare export function it(label: string, fn: (...Array<any>) => any): void;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment