mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
added types for chai-snapshot-matcher (#48130)
* added types for chai-snapshot-matcher * added missing overload and optional params
This commit is contained in:
parent
aa5ac1d7ab
commit
f4cab83772
19
types/chai-snapshot-matcher/chai-snapshot-matcher-tests.ts
Normal file
19
types/chai-snapshot-matcher/chai-snapshot-matcher-tests.ts
Normal file
@ -0,0 +1,19 @@
|
||||
import chai = require('chai');
|
||||
|
||||
const { expect } = chai;
|
||||
const context: Mocha.Context = <any> {};
|
||||
|
||||
expect('foo').to.matchSnapshot(context);
|
||||
expect('foo').to.matchSnapshot(context, 'hint');
|
||||
|
||||
expect('foo').to.matchSpecificSnapshot(context);
|
||||
expect('foo').to.matchSpecificSnapshot(context, { hint: "(hint)" });
|
||||
expect('foo').to.matchSpecificSnapshot(context, { name: "snapshot with a specific name" });
|
||||
expect('foo').to.matchSpecificSnapshot(context, { folder: "Examples" });
|
||||
expect('foo').to.matchSpecificSnapshot(context, { snapshotPath: "/Users/my.user/Downloads/MySnapshots/" });
|
||||
expect('foo').to.matchSpecificSnapshot(context, {
|
||||
hint: "(hint)",
|
||||
name: "snapshot with a specific name",
|
||||
folder: "Examples",
|
||||
snapshotPath: "/Users/my.user/Downloads/MySnapshots/"
|
||||
});
|
||||
25
types/chai-snapshot-matcher/index.d.ts
vendored
Normal file
25
types/chai-snapshot-matcher/index.d.ts
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
// Type definitions for chai-snapshot-matcher 1.0
|
||||
// Project: https://github.com/tlameiras/chai-snapshot#readme
|
||||
// Definitions by: tpluscode <https://github.com/tpluscode>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 3.0
|
||||
|
||||
/// <reference types="chai" />
|
||||
|
||||
import { Context } from 'mocha';
|
||||
|
||||
declare global {
|
||||
namespace Chai {
|
||||
interface Assertion {
|
||||
matchSnapshot(that: Context, hint?: string): void;
|
||||
matchSpecificSnapshot(that: Context, options?: {
|
||||
hint?: string;
|
||||
name?: string;
|
||||
folder?: string;
|
||||
snapshotPath?: string;
|
||||
}): void;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export {};
|
||||
23
types/chai-snapshot-matcher/tsconfig.json
Normal file
23
types/chai-snapshot-matcher/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"chai-snapshot-matcher-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/chai-snapshot-matcher/tslint.json
Normal file
1
types/chai-snapshot-matcher/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user