File tree 2 files changed +6
-5
lines changed
2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -7,15 +7,17 @@ const fakeTimers = require("./sinon/util/fake-timers");
7
7
const Sandbox = require ( "./sinon/sandbox" ) ;
8
8
const stub = require ( "./sinon/stub" ) ;
9
9
const promise = require ( "./sinon/promise" ) ;
10
- const assert = require ( "node:assert" ) ;
10
+ const nise = require ( "nise" ) ;
11
+ const assert = require ( "assert" ) ;
11
12
12
13
/**
13
14
* @param {object } opts injection point to override the default XHR lib in testing
14
15
* @param {object } opts.sinonXhrLib
15
16
* @returns {object } a configured sandbox
16
17
*/
17
- module . exports = function createApi ( { sinonXhrLib } ) {
18
- assert ( sinonXhrLib , "No XHR lib passed in" ) ;
18
+ module . exports = function createApi ( opts = { sinonXhrLib : nise } ) {
19
+ assert ( opts ?. sinonXhrLib , "No XHR lib passed in" ) ;
20
+ const { sinonXhrLib } = opts ;
19
21
20
22
const apiMethods = {
21
23
createSandbox : createSandbox ,
Original file line number Diff line number Diff line change 1
1
"use strict" ;
2
2
3
- const nise = require ( "nise" ) ;
4
3
const createApi = require ( "./create-sinon-api" ) ;
5
4
6
- module . exports = createApi ( { sinonXhrLib : nise } ) ;
5
+ module . exports = createApi ( ) ;
You can’t perform that action at this time.
0 commit comments