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:
Ryan Cavanaugh
2017-04-17 18:52:46 -07:00
committed by GitHub
4 changed files with 73 additions and 0 deletions

25
types/sinon-test/index.d.ts vendored Normal file
View 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;

View 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();

View 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"
]
}

View File

@@ -0,0 +1 @@
{ "extends": "../tslint.json" }