diff --git a/types/sinon-test/index.d.ts b/types/sinon-test/index.d.ts new file mode 100644 index 0000000000..01fe7cd484 --- /dev/null +++ b/types/sinon-test/index.d.ts @@ -0,0 +1,25 @@ +// Type definitions for sinon-test v1.0.1 +// Project: https://github.com/sinonjs/sinon-test +// Definitions by: Francis Saul +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +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; diff --git a/types/sinon-test/sinon-test-tests.ts b/types/sinon-test/sinon-test-tests.ts new file mode 100644 index 0000000000..83f7e5c65c --- /dev/null +++ b/types/sinon-test/sinon-test-tests.ts @@ -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(); diff --git a/types/sinon-test/tsconfig.json b/types/sinon-test/tsconfig.json new file mode 100644 index 0000000000..3f98705174 --- /dev/null +++ b/types/sinon-test/tsconfig.json @@ -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" + ] +} diff --git a/types/sinon-test/tslint.json b/types/sinon-test/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/types/sinon-test/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" }