@luvio/adapter-test-library 0.135.2 → 0.135.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -4,10 +4,6 @@
|
|
|
4
4
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.luvioAdapterTestLibrary = {}, global.sinon));
|
|
5
5
|
})(this, (function (exports, sinon) { 'use strict';
|
|
6
6
|
|
|
7
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
-
|
|
9
|
-
var sinon__default = /*#__PURE__*/_interopDefaultLegacy(sinon);
|
|
10
|
-
|
|
11
7
|
/**
|
|
12
8
|
* Clone an object
|
|
13
9
|
*
|
|
@@ -118,7 +114,7 @@
|
|
|
118
114
|
}
|
|
119
115
|
function buildMockNetworkAdapter(mockPayloads) {
|
|
120
116
|
// any endpoints not setup with a fake will return a rejected promise
|
|
121
|
-
const networkAdapter =
|
|
117
|
+
const networkAdapter = sinon.stub().rejects(buildMockSetupError());
|
|
122
118
|
callCountMap.set(networkAdapter, 0);
|
|
123
119
|
mockPayloadsMap.set(networkAdapter, mockPayloads);
|
|
124
120
|
setMockNetworkPayloads(networkAdapter, mockPayloads);
|
|
@@ -150,7 +146,7 @@
|
|
|
150
146
|
// sort mock payloads so least-specific network args are registered first
|
|
151
147
|
mockPayloads.sort(sortPayloads).forEach((mockPayload) => {
|
|
152
148
|
const { networkArgs, response } = mockPayload;
|
|
153
|
-
const args =
|
|
149
|
+
const args = sinon.match(networkArgs);
|
|
154
150
|
stub.withArgs(args).callsFake(() => {
|
|
155
151
|
return onNetworkStubCalled(stub, response);
|
|
156
152
|
});
|
|
@@ -172,7 +168,7 @@
|
|
|
172
168
|
function overrideMockNetworkResponses(mockNetworkAdapter, responses) {
|
|
173
169
|
const stub = mockNetworkAdapter;
|
|
174
170
|
let index = 0;
|
|
175
|
-
stub.withArgs(
|
|
171
|
+
stub.withArgs(sinon.match.any).callsFake(() => {
|
|
176
172
|
const response = responses[index++];
|
|
177
173
|
if (response === undefined) {
|
|
178
174
|
// if they have more requests than expected
|
|
@@ -444,6 +440,4 @@
|
|
|
444
440
|
exports.stripProperties = stripProperties;
|
|
445
441
|
exports.verifyImmutable = verifyImmutable;
|
|
446
442
|
|
|
447
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
448
|
-
|
|
449
443
|
}));
|
|
@@ -4,10 +4,6 @@
|
|
|
4
4
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.luvioAdapterTestLibrary = {}, global.sinon));
|
|
5
5
|
})(this, (function (exports, sinon) { 'use strict';
|
|
6
6
|
|
|
7
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
-
|
|
9
|
-
var sinon__default = /*#__PURE__*/_interopDefaultLegacy(sinon);
|
|
10
|
-
|
|
11
7
|
/******************************************************************************
|
|
12
8
|
Copyright (c) Microsoft Corporation.
|
|
13
9
|
|
|
@@ -184,7 +180,7 @@
|
|
|
184
180
|
}
|
|
185
181
|
function buildMockNetworkAdapter(mockPayloads) {
|
|
186
182
|
// any endpoints not setup with a fake will return a rejected promise
|
|
187
|
-
var networkAdapter =
|
|
183
|
+
var networkAdapter = sinon.stub().rejects(buildMockSetupError());
|
|
188
184
|
callCountMap.set(networkAdapter, 0);
|
|
189
185
|
mockPayloadsMap.set(networkAdapter, mockPayloads);
|
|
190
186
|
setMockNetworkPayloads(networkAdapter, mockPayloads);
|
|
@@ -216,7 +212,7 @@
|
|
|
216
212
|
// sort mock payloads so least-specific network args are registered first
|
|
217
213
|
mockPayloads.sort(sortPayloads).forEach(function (mockPayload) {
|
|
218
214
|
var networkArgs = mockPayload.networkArgs, response = mockPayload.response;
|
|
219
|
-
var args =
|
|
215
|
+
var args = sinon.match(networkArgs);
|
|
220
216
|
stub.withArgs(args).callsFake(function () {
|
|
221
217
|
return onNetworkStubCalled(stub, response);
|
|
222
218
|
});
|
|
@@ -238,7 +234,7 @@
|
|
|
238
234
|
function overrideMockNetworkResponses(mockNetworkAdapter, responses) {
|
|
239
235
|
var stub = mockNetworkAdapter;
|
|
240
236
|
var index = 0;
|
|
241
|
-
stub.withArgs(
|
|
237
|
+
stub.withArgs(sinon.match.any).callsFake(function () {
|
|
242
238
|
var response = responses[index++];
|
|
243
239
|
if (response === undefined) {
|
|
244
240
|
// if they have more requests than expected
|
|
@@ -634,6 +630,4 @@
|
|
|
634
630
|
exports.stripProperties = stripProperties;
|
|
635
631
|
exports.verifyImmutable = verifyImmutable;
|
|
636
632
|
|
|
637
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
638
|
-
|
|
639
633
|
}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luvio/adapter-test-library",
|
|
3
|
-
"version": "0.135.
|
|
3
|
+
"version": "0.135.4",
|
|
4
4
|
"description": "Test library for luvio adapters",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"module": "dist/es/es2018/test-library.js",
|
|
13
13
|
"types": "dist/es/es2018/main.d.ts",
|
|
14
14
|
"scripts": {
|
|
15
|
-
"build": "rollup --config rollup.config.js",
|
|
15
|
+
"build": "rollup --bundleConfigAsCjs --config rollup.config.js",
|
|
16
16
|
"clean": "rm -rf dist",
|
|
17
17
|
"test": "jest",
|
|
18
18
|
"watch": "yarn build --watch"
|
|
@@ -21,10 +21,13 @@
|
|
|
21
21
|
"sinon": "^14.0.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@luvio/engine": "^0.135.
|
|
25
|
-
"@luvio/environments": "^0.135.
|
|
24
|
+
"@luvio/engine": "^0.135.4",
|
|
25
|
+
"@luvio/environments": "^0.135.4",
|
|
26
26
|
"@types/sinon": "^7.5.2"
|
|
27
27
|
},
|
|
28
|
+
"volta": {
|
|
29
|
+
"extends": "../../../package.json"
|
|
30
|
+
},
|
|
28
31
|
"nx": {
|
|
29
32
|
"targets": {
|
|
30
33
|
"build": {
|