relay-test-utils 19.0.0 → 20.1.0
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.
@@ -82,7 +82,7 @@ type MockResolver = (
|
|
82
82
|
context: MockResolverContext,
|
83
83
|
generateId: () => number,
|
84
84
|
) => mixed;
|
85
|
-
export type MockResolvers = {[typeName: string]: MockResolver, ...};
|
85
|
+
export type MockResolvers = {+[typeName: string]: MockResolver, ...};
|
86
86
|
|
87
87
|
type SelectionMetadata = {
|
88
88
|
[selectionPath: string]: {
|
@@ -259,6 +259,11 @@ function createMockEnvironment(
|
|
259
259
|
pendingRequests = pendingRequests.filter(
|
260
260
|
pending => !areEqual(pending, nextRequest),
|
261
261
|
);
|
262
|
+
const currentOperation = pendingOperations.find(
|
263
|
+
op =>
|
264
|
+
areEqual(op.request.node.params, request) &&
|
265
|
+
areEqual(op.request.variables, variables),
|
266
|
+
);
|
262
267
|
pendingOperations = pendingOperations.filter(
|
263
268
|
op => op !== currentOperation,
|
264
269
|
);
|
package/index.js
CHANGED
@@ -121,6 +121,9 @@ function createMockEnvironment(config) {
|
|
121
121
|
pendingRequests = pendingRequests.filter(function (pending) {
|
122
122
|
return !areEqual(pending, nextRequest);
|
123
123
|
});
|
124
|
+
var currentOperation = pendingOperations.find(function (op) {
|
125
|
+
return areEqual(op.request.node.params, request) && areEqual(op.request.variables, variables);
|
126
|
+
});
|
124
127
|
pendingOperations = pendingOperations.filter(function (op) {
|
125
128
|
return op !== currentOperation;
|
126
129
|
});
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "relay-test-utils",
|
3
3
|
"description": "Utilities for testing Relay applications.",
|
4
|
-
"version": "
|
4
|
+
"version": "20.1.0",
|
5
5
|
"keywords": [
|
6
6
|
"graphql",
|
7
7
|
"relay"
|
@@ -18,7 +18,7 @@
|
|
18
18
|
"@babel/runtime": "^7.25.0",
|
19
19
|
"fbjs": "^3.0.2",
|
20
20
|
"invariant": "^2.2.4",
|
21
|
-
"relay-runtime": "
|
21
|
+
"relay-runtime": "20.1.0"
|
22
22
|
},
|
23
23
|
"directories": {
|
24
24
|
"": "./"
|