Merge pull request #23102 from JoshuaKGoldberg/jest-class-names-describe

Allowed functions in jest's describe
This commit is contained in:
Mine Starks
2018-03-21 09:09:17 -07:00
committed by GitHub
2 changed files with 11 additions and 1 deletions
+7 -1
View File
@@ -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;
}
+4
View File
@@ -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');