mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-16 23:10:29 +00:00
This reverts commit 49ecfa4536.
This commit is contained in:
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: https://github.com/tubalmartin/karma-chai-sinon
|
||||
// Definitions by: Václav Ostrožlík <https://github.com/vasek17>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="chai" />
|
||||
import Sinon = require("sinon");
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: https://github.com/pawelgalazka/mochaccino#readme
|
||||
// Definitions by: Thomas-P <https://github.com/thomas-p>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
// TypeScript Version: 2.3
|
||||
import * as Sinon from "sinon";
|
||||
export interface Expect {
|
||||
not: Expect;
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: https://github.com/shouldjs/sinon
|
||||
// Definitions by: AryloYeung <https://github.com/Arylo>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import * as s from "sinon";
|
||||
import should = require("should");
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: https://github.com/bendrucker/sinon-as-promised
|
||||
// Definitions by: igrayson <https://github.com/igrayson>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import * as s from "sinon";
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: https://github.com/domenic/sinon-chai
|
||||
// Definitions by: Kazi Manzur Rashid <https://github.com/kazimanzurrashid>, Jed Mao <https://github.com/jedmao>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="chai" />
|
||||
/// <reference types="sinon" />
|
||||
|
||||
Vendored
+1
-1
@@ -4,7 +4,7 @@
|
||||
// CRIMX <https://github.com/crimx>
|
||||
// kobanyan <https://github.com/kobanyan>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
// TypeScript Version: 2.4
|
||||
|
||||
/// <reference types="chrome"/>
|
||||
/// <reference types="sinon"/>
|
||||
|
||||
Vendored
+1
-1
@@ -3,7 +3,7 @@
|
||||
// Definitions by: Jared Chapiewsky <https://github.com/jpchip>
|
||||
// Tomek Łaziuk <https://github.com/tlaziuk>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import {
|
||||
SinonStub,
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: https://github.com/underscopeio/sinon-mongoose
|
||||
// Definitions by: stevehipwell <https://github.com/stevehipwell>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import * as s from "sinon";
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -3,7 +3,7 @@
|
||||
// Definitions by: Thiago Temple <https://github.com/vintem>
|
||||
// Tim Stackhouse <https://github.com/tstackhouse>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="sinon"/>
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: https://github.com/sinonjs/sinon-test
|
||||
// Definitions by: Francis Saul <https://github.com/mummybot>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import * as Sinon from 'sinon';
|
||||
|
||||
|
||||
Vendored
+3
-9
@@ -5,9 +5,8 @@
|
||||
// Lukas Spieß <https://github.com/lumaxis>
|
||||
// Nico Jansen <https://github.com/nicojs>
|
||||
// James Garbutt <https://github.com/43081j>
|
||||
// Josh Goldberg <https://github.com/joshuakgoldberg>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
// sinon uses DOM dependencies which are absent in browser-less environment like node.js
|
||||
// to avoid compiler errors this monkey patch is used
|
||||
@@ -567,20 +566,15 @@ declare namespace Sinon {
|
||||
}
|
||||
|
||||
/**
|
||||
* An instance of a stubbed object type with functions replaced by stubs.
|
||||
* An instance of a stubbed object type with members replaced by stubs.
|
||||
*
|
||||
* @template TType Object type being stubbed.
|
||||
*/
|
||||
type SinonStubbedInstance<TType> = {
|
||||
// TODO: this should really only replace functions on TType with SinonStubs, not all properties
|
||||
// Likely infeasible without mapped conditional types, per https://github.com/Microsoft/TypeScript/issues/12424
|
||||
[P in keyof TType]: SinonStubbedMember<TType[P]>;
|
||||
[P in keyof TType]: SinonStub;
|
||||
};
|
||||
|
||||
/**
|
||||
* Replaces a type with a Sinon stub if it's a function.
|
||||
*/
|
||||
type SinonStubbedMember<T> = T extends Function ? SinonStub : T;
|
||||
}
|
||||
|
||||
declare const Sinon: Sinon.SinonStatic;
|
||||
|
||||
@@ -154,15 +154,6 @@ function testSandbox() {
|
||||
sandbox.createStubInstance<TestCreateStubInstance>(TestCreateStubInstance).someTestMethod('some argument');
|
||||
}
|
||||
|
||||
class OneFunctionOneNumber {
|
||||
memberFunction() { }
|
||||
memberNumber: number;
|
||||
}
|
||||
|
||||
const stubInstance = sinon.createStubInstance<OneFunctionOneNumber>(OneFunctionOneNumber);
|
||||
const memberFunction: sinon.SinonStub = stubInstance.memberFunction;
|
||||
const memberNumber: number = stubInstance.memberNumber;
|
||||
|
||||
function testPromises() {
|
||||
let resolveStub = sinon.stub().resolves();
|
||||
resolveStub = sinon.stub().resolves(10);
|
||||
|
||||
Reference in New Issue
Block a user