22
33const arrayProto = require ( "@sinonjs/commons" ) . prototypes . array ;
44const logger = require ( "@sinonjs/commons" ) . deprecated ;
5- const wrap = logger . wrap ;
65const collectOwnMethods = require ( "./collect-own-methods" ) ;
76const getPropertyDescriptor = require ( "./util/core/get-property-descriptor" ) ;
87const isPropertyConfigurable = require ( "./util/core/is-property-configurable" ) ;
@@ -15,7 +14,6 @@ const sinonStub = require("./stub");
1514const sinonCreateStubInstance = require ( "./create-stub-instance" ) ;
1615const sinonFake = require ( "./fake" ) ;
1716const valueToString = require ( "@sinonjs/commons" ) . valueToString ;
18- const usePromiseLibrary = require ( "./util/core/use-promise-library" ) ;
1917
2018const DEFAULT_LEAK_THRESHOLD = 10000 ;
2119
@@ -79,7 +77,6 @@ function Sandbox(opts = {}) {
7977 const sandbox = this ;
8078 const assertOptions = opts . assertOptions || { } ;
8179 let fakeRestorers = [ ] ;
82- let promiseLib ;
8380
8481 let collection = [ ] ;
8582 let loggedLeakWarning = false ;
@@ -114,8 +111,6 @@ function Sandbox(opts = {}) {
114111 addToCollection ( method ) ;
115112 } ) ;
116113
117- usePromiseLibrary ( promiseLib , ownMethods ) ;
118-
119114 return stubbed ;
120115 } ;
121116
@@ -169,7 +164,6 @@ function Sandbox(opts = {}) {
169164 const m = sinonMock . apply ( null , arguments ) ;
170165
171166 addToCollection ( m ) ;
172- usePromiseLibrary ( promiseLib , m ) ;
173167
174168 return m ;
175169 } ;
@@ -422,16 +416,12 @@ function Sandbox(opts = {}) {
422416 forEach ( ownMethods , function ( method ) {
423417 addToCollection ( method ) ;
424418 } ) ;
425-
426- usePromiseLibrary ( promiseLib , ownMethods ) ;
427419 } else if ( Array . isArray ( types ) ) {
428420 for ( const accessorType of types ) {
429421 addToCollection ( spy [ accessorType ] ) ;
430- usePromiseLibrary ( promiseLib , spy [ accessorType ] ) ;
431422 }
432423 } else {
433424 addToCollection ( spy ) ;
434- usePromiseLibrary ( promiseLib , spy ) ;
435425 }
436426
437427 return spy ;
@@ -497,18 +487,6 @@ function Sandbox(opts = {}) {
497487 throw exception ;
498488 }
499489 } ;
500-
501- function usingPromise ( promiseLibrary ) {
502- promiseLib = promiseLibrary ;
503- collection . promiseLibrary = promiseLibrary ;
504-
505- return sandbox ;
506- }
507-
508- sandbox . usingPromise = wrap (
509- usingPromise ,
510- "usingPromise has been deprecated, and will be removed in the next major version" ,
511- ) ;
512490}
513491
514492Sandbox . prototype . match = match ;
0 commit comments