mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-09 19:50:08 +00:00
Initial definition for @wordpress/jest-console
This commit is contained in:
51
types/wordpress__jest-console/index.d.ts
vendored
Normal file
51
types/wordpress__jest-console/index.d.ts
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
// Type definitions for @wordpress/jest-console 3.0
|
||||
// Project: https://github.com/wordpress/gutenberg/tree/master/packages/jest-console/readme.md
|
||||
// Definitions by: Damien Sorel <https://github.com/mistic100>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 3.0
|
||||
|
||||
/// <reference types="jest" />
|
||||
|
||||
declare namespace jest {
|
||||
interface Matchers<R> {
|
||||
/**
|
||||
* Ensure that `console.error` function was called.
|
||||
*/
|
||||
toHaveErrored(): R;
|
||||
|
||||
/**
|
||||
* Ensure that `console.error` function was called with specific arguments.
|
||||
*/
|
||||
toHaveErroredWith(...args: any[]): R;
|
||||
|
||||
/**
|
||||
* Ensure that `console.info` function was called.
|
||||
*/
|
||||
toHaveInformed(): R;
|
||||
|
||||
/**
|
||||
* Ensure that `console.info` function was called with specific arguments.
|
||||
*/
|
||||
toHaveInformedWith(...args: any[]): R;
|
||||
|
||||
/**
|
||||
* Ensure that `console.log` function was called.
|
||||
*/
|
||||
toHaveLogged(): R;
|
||||
|
||||
/**
|
||||
* Ensure that `console.log` function was called with specific arguments.
|
||||
*/
|
||||
toHaveLoggedWith(...args: any[]): R;
|
||||
|
||||
/**
|
||||
* Ensure that `console.warn` function was called.
|
||||
*/
|
||||
toHaveWarned(): R;
|
||||
|
||||
/**
|
||||
* Ensure that `console.warn` function was called with specific arguments.
|
||||
*/
|
||||
toHaveWarnedWith(...args: any[]): R;
|
||||
}
|
||||
}
|
||||
13
types/wordpress__jest-console/jest-console-tests.ts
Normal file
13
types/wordpress__jest-console/jest-console-tests.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
it('uses the console', () => {
|
||||
expect(console).toHaveErrored();
|
||||
expect(console).toHaveErroredWith('message');
|
||||
|
||||
expect(console).toHaveInformed();
|
||||
expect(console).toHaveInformedWith('message');
|
||||
|
||||
expect(console).toHaveLogged();
|
||||
expect(console).toHaveLoggedWith('message');
|
||||
|
||||
expect(console).toHaveWarned();
|
||||
expect(console).toHaveWarnedWith('message');
|
||||
});
|
||||
24
types/wordpress__jest-console/tsconfig.json
Normal file
24
types/wordpress__jest-console/tsconfig.json
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"jest-console-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/wordpress__jest-console/tslint.json
Normal file
1
types/wordpress__jest-console/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user