@shopify/graphql-testing
Advanced tools
Comparing version 5.1.9 to 6.0.0
@@ -5,3 +5,2 @@ 'use strict'; | ||
var _rollupPluginBabelHelpers = require('./_virtual/_rollupPluginBabelHelpers.js'); | ||
var apolloLink = require('apollo-link'); | ||
@@ -35,3 +34,3 @@ var apolloCacheInmemory = require('apollo-cache-inmemory'); | ||
const cache = new apolloCacheInmemory.InMemoryCache(_rollupPluginBabelHelpers.objectSpread2({ | ||
const cache = new apolloCacheInmemory.InMemoryCache({ | ||
fragmentMatcher: new apolloCacheInmemory.IntrospectionFragmentMatcher({ | ||
@@ -43,4 +42,5 @@ introspectionQueryResultData: { | ||
} | ||
}) | ||
}, cacheOptions)); | ||
}), | ||
...cacheOptions | ||
}); | ||
this.mockLink = new mocks.MockLink(mock || defaultGraphQLMock); | ||
@@ -65,20 +65,16 @@ const link = apolloLink.ApolloLink.from([new inflight.InflightLink({ | ||
resolveAll(options = {}) { | ||
var _this = this; | ||
return _rollupPluginBabelHelpers.asyncToGenerator(function* () { | ||
const finalOperationName = utilities.operationNameFromFindOptions(options); | ||
yield _this.wrappers.reduce((perform, wrapper) => { | ||
return () => wrapper(perform); | ||
}, /*#__PURE__*/_rollupPluginBabelHelpers.asyncToGenerator(function* () { | ||
const allPendingRequests = Array.from(_this.pendingRequests); | ||
const matchingRequests = finalOperationName ? allPendingRequests.filter(({ | ||
operation: { | ||
operationName | ||
} | ||
}) => operationName === finalOperationName) : allPendingRequests; | ||
yield Promise.all(matchingRequests.map(({ | ||
resolve | ||
}) => resolve())); | ||
}))(); | ||
async resolveAll(options = {}) { | ||
const finalOperationName = utilities.operationNameFromFindOptions(options); | ||
await this.wrappers.reduce((perform, wrapper) => { | ||
return () => wrapper(perform); | ||
}, async () => { | ||
const allPendingRequests = Array.from(this.pendingRequests); | ||
const matchingRequests = finalOperationName ? allPendingRequests.filter(({ | ||
operation: { | ||
operationName | ||
} | ||
}) => operationName === finalOperationName) : allPendingRequests; | ||
await Promise.all(matchingRequests.map(({ | ||
resolve | ||
}) => resolve())); | ||
})(); | ||
@@ -85,0 +81,0 @@ } |
{ | ||
"name": "@shopify/graphql-testing", | ||
"version": "5.1.9", | ||
"version": "6.0.0", | ||
"license": "MIT", | ||
@@ -31,3 +31,3 @@ "description": "Utilities to create mock GraphQL factories", | ||
"engines": { | ||
"node": ">=12.14.0" | ||
"node": "^14.17.0 || >=16.0.0" | ||
}, | ||
@@ -42,3 +42,3 @@ "dependencies": { | ||
"devDependencies": { | ||
"graphql-typed": "^1.1.5" | ||
"graphql-typed": "^2.0.0" | ||
}, | ||
@@ -68,6 +68,5 @@ "files": [ | ||
"require": "./index.js" | ||
}, | ||
"./*": "./*" | ||
} | ||
}, | ||
"gitHead": "70feded397084daea784a8c5a523a61ac4fdb34c" | ||
"gitHead": "ef9afc562672dcda9d7800753dc6b777ecd2d751" | ||
} |
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
63618
68
877