mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-19 16:49:45 +08:00
Merge pull request #15735 from mummybot/sinon-test
Types for sinon-test 1.0.1 Promise sandbox wrapper after it was spun out of SinonJS
This commit is contained in:
25
types/sinon-test/index.d.ts
vendored
Normal file
25
types/sinon-test/index.d.ts
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
// Type definitions for sinon-test v1.0.1
|
||||
// Project: https://github.com/sinonjs/sinon-test
|
||||
// Definitions by: Francis Saul <https://github.com/mummybot>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="sinon" />
|
||||
|
||||
import * as Sinon from 'sinon';
|
||||
|
||||
interface Configuration {
|
||||
injectIntoThis?: boolean;
|
||||
injectInto?: any;
|
||||
properties?: Array<"spy"| "stub"| "mock"| "clock"| "server"| "requests">;
|
||||
useFakeTimers?: boolean;
|
||||
useFakeServer?: boolean;
|
||||
}
|
||||
|
||||
interface sinonTest {
|
||||
configureTest(sinon: Sinon.SinonStatic, config?: Configuration): any;
|
||||
configureTestCase(sinon: Sinon.SinonStatic, config?: Configuration): any;
|
||||
}
|
||||
|
||||
declare var sinonTest: sinonTest;
|
||||
|
||||
export = sinonTest;
|
||||
25
types/sinon-test/sinon-test-tests.ts
Normal file
25
types/sinon-test/sinon-test-tests.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import * as sinon from 'sinon';
|
||||
import * as sinonTest from 'sinon-test';
|
||||
|
||||
function testConfigure() {
|
||||
const test = sinonTest.configureTest(sinon, {
|
||||
injectIntoThis: true,
|
||||
injectInto: true,
|
||||
properties: ["spy", "stub", "mock", "clock", "server", "requests"],
|
||||
useFakeTimers: true,
|
||||
useFakeServer: true
|
||||
});
|
||||
}
|
||||
|
||||
function testConfigureTestCase() {
|
||||
const test = sinonTest.configureTestCase(sinon, {
|
||||
injectIntoThis: true,
|
||||
injectInto: true,
|
||||
properties: ["spy", "stub", "mock", "clock", "server", "requests"],
|
||||
useFakeTimers: true,
|
||||
useFakeServer: true
|
||||
});
|
||||
}
|
||||
|
||||
testConfigure();
|
||||
testConfigureTestCase();
|
||||
22
types/sinon-test/tsconfig.json
Normal file
22
types/sinon-test/tsconfig.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"sinon-test-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/sinon-test/tslint.json
Normal file
1
types/sinon-test/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "../tslint.json" }
|
||||
Reference in New Issue
Block a user