2
2
3
3
const arrayProto = require ( "@sinonjs/commons" ) . prototypes . array ;
4
4
const logger = require ( "@sinonjs/commons" ) . deprecated ;
5
- const wrap = logger . wrap ;
6
5
const collectOwnMethods = require ( "./collect-own-methods" ) ;
7
6
const getPropertyDescriptor = require ( "./util/core/get-property-descriptor" ) ;
8
7
const isPropertyConfigurable = require ( "./util/core/is-property-configurable" ) ;
@@ -15,7 +14,6 @@ const sinonStub = require("./stub");
15
14
const sinonCreateStubInstance = require ( "./create-stub-instance" ) ;
16
15
const sinonFake = require ( "./fake" ) ;
17
16
const valueToString = require ( "@sinonjs/commons" ) . valueToString ;
18
- const usePromiseLibrary = require ( "./util/core/use-promise-library" ) ;
19
17
20
18
const DEFAULT_LEAK_THRESHOLD = 10000 ;
21
19
@@ -79,7 +77,6 @@ function Sandbox(opts = {}) {
79
77
const sandbox = this ;
80
78
const assertOptions = opts . assertOptions || { } ;
81
79
let fakeRestorers = [ ] ;
82
- let promiseLib ;
83
80
84
81
let collection = [ ] ;
85
82
let loggedLeakWarning = false ;
@@ -114,8 +111,6 @@ function Sandbox(opts = {}) {
114
111
addToCollection ( method ) ;
115
112
} ) ;
116
113
117
- usePromiseLibrary ( promiseLib , ownMethods ) ;
118
-
119
114
return stubbed ;
120
115
} ;
121
116
@@ -169,7 +164,6 @@ function Sandbox(opts = {}) {
169
164
const m = sinonMock . apply ( null , arguments ) ;
170
165
171
166
addToCollection ( m ) ;
172
- usePromiseLibrary ( promiseLib , m ) ;
173
167
174
168
return m ;
175
169
} ;
@@ -422,16 +416,12 @@ function Sandbox(opts = {}) {
422
416
forEach ( ownMethods , function ( method ) {
423
417
addToCollection ( method ) ;
424
418
} ) ;
425
-
426
- usePromiseLibrary ( promiseLib , ownMethods ) ;
427
419
} else if ( Array . isArray ( types ) ) {
428
420
for ( const accessorType of types ) {
429
421
addToCollection ( spy [ accessorType ] ) ;
430
- usePromiseLibrary ( promiseLib , spy [ accessorType ] ) ;
431
422
}
432
423
} else {
433
424
addToCollection ( spy ) ;
434
- usePromiseLibrary ( promiseLib , spy ) ;
435
425
}
436
426
437
427
return spy ;
@@ -497,18 +487,6 @@ function Sandbox(opts = {}) {
497
487
throw exception ;
498
488
}
499
489
} ;
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
- ) ;
512
490
}
513
491
514
492
Sandbox . prototype . match = match ;
0 commit comments