mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
Merge pull request #23102 from JoshuaKGoldberg/jest-class-names-describe
Allowed functions in jest's describe
This commit is contained in:
Vendored
+7
-1
@@ -11,6 +11,7 @@
|
||||
// Jamie Mason <https://github.com/JamieMason>
|
||||
// Douglas Duteil <https://github.com/douglasduteil>
|
||||
// Ahn <https://github.com/AhnpGit>
|
||||
// Josh Goldberg <https://github.com/joshuakgoldberg>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -201,6 +202,10 @@ declare namespace jest {
|
||||
|
||||
type Lifecycle = (fn: ProvidesCallback, timeout?: number) => any;
|
||||
|
||||
interface FunctionLike {
|
||||
readonly name: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a test closure
|
||||
*/
|
||||
@@ -222,7 +227,8 @@ declare namespace jest {
|
||||
}
|
||||
|
||||
interface Describe {
|
||||
(name: string, fn: EmptyFunction): void;
|
||||
// tslint:disable-next-line ban-types
|
||||
(name: number | string | Function | FunctionLike, fn: EmptyFunction): void;
|
||||
only: Describe;
|
||||
skip: Describe;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,10 @@ declare const $: any;
|
||||
// Tests based on the Jest website
|
||||
jest.unmock('../sum');
|
||||
|
||||
class TestClass { }
|
||||
|
||||
describe(TestClass, () => { });
|
||||
|
||||
describe('sum', () => {
|
||||
it('adds 1 + 2 to equal 3', () => {
|
||||
const sum: (a: number, b: number) => number = require('../sum');
|
||||
|
||||
Reference in New Issue
Block a user