Introduce type definitions for jest-expect-message (#34890)

* Introduce type definitions for jest-expect-message

* Fix review comment (remove declare global)
This commit is contained in:
Mikhail Davydov 2019-05-01 19:56:39 -04:00 committed by Pranav Senthilnathan
parent 93b2b363a1
commit 1e697cb6e6
4 changed files with 45 additions and 0 deletions

13
types/jest-expect-message/index.d.ts vendored Normal file
View File

@ -0,0 +1,13 @@
// Type definitions for jest-expect-message 1.0
// Project: https://github.com/mattphillips/jest-expect-message#readme
// Definitions by: Mike Davydov <https://github.com/mike-d-davydov>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.4
/// <reference types="jest"/>
declare namespace jest {
interface Expect {
<T = any>(actual: T, message: string): Matchers<T>;
}
}

View File

@ -0,0 +1,6 @@
import 'jest';
import 'jest-expect-message';
declare const expect: jest.Expect;
expect(2, "Two is always two").toBe(2);

View File

@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"jest-expect-message-tests.ts"
]
}

View File

@ -0,0 +1,3 @@
{
"extends": "dtslint/dt.json"
}