diff --git a/jest/index.d.ts b/jest/index.d.ts index dc0260cebb..cf50596d55 100644 --- a/jest/index.d.ts +++ b/jest/index.d.ts @@ -91,7 +91,7 @@ declare namespace jest { } interface ProvidesCallback { - (cb?: DoneCallback): any; + (cb: DoneCallback): any; } interface Lifecycle { @@ -99,7 +99,7 @@ declare namespace jest { } interface It { - (name: string, fn: ProvidesCallback): void; + (name: string, fn?: ProvidesCallback): void; only: It; skip: It; concurrent: It; diff --git a/jest/jest-tests.ts b/jest/jest-tests.ts index 4b81f6282c..913a671fa1 100644 --- a/jest/jest-tests.ts +++ b/jest/jest-tests.ts @@ -358,3 +358,12 @@ describe('genMockFromModule', function () { }); }); }); + +/** + * Pass strictNullChecks + */ +describe('strictNullChecks', function () { + it('does not complain when using done callback', (done) => { + done(); + }) +}); diff --git a/jest/tsconfig.json b/jest/tsconfig.json index 0ad43c6b19..da1e33c024 100644 --- a/jest/tsconfig.json +++ b/jest/tsconfig.json @@ -3,7 +3,7 @@ "module": "commonjs", "target": "es6", "noImplicitAny": true, - "strictNullChecks": false, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../"