Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
afterEach(() => {
fetchMock.reset();
fetchMock.restore();
// fetchMock
// .getOnce('/todos', { body: { todos: ['do something'] }, headers: { 'content-type': 'application/json' } });
});
afterEach(async () => {
await client.clearCache();
if (onMainThread) fetchMock.reset();
result = undefined;
await client.request(
ecom.requests.removeMutation,
{ awaitDataCached: true, variables: { productID: "402-5806" } },
);
});
afterEach(async () => {
await client.clearCache();
fetchMock.reset();
result = undefined;
await client.request(
ecom.requests.removeMutation,
{ awaitDataCached: true, variables: { productID: "402-5806" } },
);
});
passThrough(_url?: string | RegExp | undefined): void {
fetchMock.reset();
}
beforeEach(() => {
fetchMock.reset();
});
describe('Create', function() {
afterEach(fetchMock.reset)
afterEach(fetchMock.restore)
beforeEach(function() {
this.api = new Api({
url: API_URL
})
})
afterEach(function() {
this.api = undefined
})
beforeEach(function() {
fetchMock.mock(
`begin:${API_URL}/attask/api`,
fixture,
{
describe('Get', function() {
afterEach(fetchMock.reset)
afterEach(fetchMock.restore)
beforeEach(function() {
this.api = new Api({
url: API_URL
})
})
afterEach(function() {
this.api = undefined
})
describe('Call with single objId (String)', function() {
beforeEach(function() {
fetchMock.mock(
`begin:${API_URL}/attask/api`,
getFixture,
afterEach(async () => {
await client.clearCache();
if (onMainThread) fetchMock.reset();
});
describe('Edit', function() {
afterEach(fetchMock.reset)
afterEach(fetchMock.restore)
beforeEach(function() {
this.api = new Api({
url: API_URL,
apiKey: 'testapikey',
alwaysUseGet: true
})
})
afterEach(function() {
this.api = undefined
})
beforeEach(function() {
fetchMock.mock(
`begin:${API_URL}/attask/api`,
setTimeout(() => {
expect(fetchMock.calls(defaultProps.getEndpoint())).toHaveLength(1);
fetchMock.reset();
}, 0);
wrapper.setProps({ ...props, controlValues: { metrics: 'avg__value' } });