@shopify/graphql-testing
Advanced tools
Comparing version 0.0.0-snapshot-20230126013201 to 0.0.0-snapshot-20230126034856
@@ -7,3 +7,2 @@ 'use strict'; | ||
var apolloCacheInmemory = require('apollo-cache-inmemory'); | ||
var isEqual = require('fast-deep-equal'); | ||
var client = require('./client.js'); | ||
@@ -15,6 +14,2 @@ var operations = require('./operations.js'); | ||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
var isEqual__default = /*#__PURE__*/_interopDefaultLegacy(isEqual); | ||
class GraphQL { | ||
@@ -83,3 +78,3 @@ constructor(mock = {}, { | ||
} | ||
}) => operationName === finalOperationName && (!options.variables || isEqual__default["default"](variables, options.variables))) : allPendingRequests; | ||
}) => operationName === finalOperationName && (!options.variables || utilities.variablesMatch(variables, options.variables))) : allPendingRequests; | ||
await Promise.all(matchingRequests.map(({ | ||
@@ -86,0 +81,0 @@ resolve |
@@ -41,4 +41,9 @@ 'use strict'; | ||
function variablesMatch(operationVariables, providedVariables) { | ||
return !Object.entries(providedVariables).some(([key, val]) => operationVariables[key] !== val); | ||
} | ||
exports.operationNameFromDocument = operationNameFromDocument; | ||
exports.operationNameFromFindOptions = operationNameFromFindOptions; | ||
exports.operationTypeFromDocument = operationTypeFromDocument; | ||
exports.variablesMatch = variablesMatch; |
@@ -11,3 +11,3 @@ import { DocumentNode } from 'graphql'; | ||
variables?: { | ||
[key: string]: any; | ||
[key: string]: string | number; | ||
}; | ||
@@ -14,0 +14,0 @@ /** |
@@ -14,2 +14,3 @@ import { DocumentNode } from 'graphql'; | ||
}): import("graphql").OperationTypeNode; | ||
export declare function variablesMatch(operationVariables: Record<string, any>, providedVariables: NonNullable<FindOptions['variables']>): boolean; | ||
//# sourceMappingURL=utilities.d.ts.map |
{ | ||
"name": "@shopify/graphql-testing", | ||
"version": "0.0.0-snapshot-20230126013201", | ||
"version": "0.0.0-snapshot-20230126034856", | ||
"license": "MIT", | ||
@@ -37,3 +37,2 @@ "description": "Utilities to create mock GraphQL factories", | ||
"apollo-link": ">=1.0.0 <2.0.0", | ||
"fast-deep-equal": "^3.1.3", | ||
"graphql": ">=14.5.0 <16.0.0", | ||
@@ -40,0 +39,0 @@ "jest-matcher-utils": "^26.6.2" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
66255
5
907
- Removedfast-deep-equal@^3.1.3
- Removedfast-deep-equal@3.1.3(transitive)