Commit 2713ddb6 authored by Justin Ho's avatar Justin Ho

Use return instead of using async / await

parent 87d28bea
......@@ -18,11 +18,11 @@ describe('ServerlessActions', () => {
});
describe('fetchFunctions', () => {
it('should successfully fetch functions', async () => {
it('should successfully fetch functions', () => {
const endpoint = '/functions';
mock.onGet(endpoint).reply(statusCodes.OK, JSON.stringify(mockServerlessFunctions));
await testAction(
return testAction(
fetchFunctions,
{ functionsPath: endpoint },
{},
......@@ -34,13 +34,13 @@ describe('ServerlessActions', () => {
);
});
it('should successfully retry', async () => {
it('should successfully retry', () => {
const endpoint = '/functions';
mock
.onGet(endpoint)
.reply(() => new Promise((resolve) => setTimeout(() => resolve(200), Infinity)));
await testAction(
return testAction(
fetchFunctions,
{ functionsPath: endpoint },
{},
......@@ -51,11 +51,11 @@ describe('ServerlessActions', () => {
});
describe('fetchMetrics', () => {
it('should return no prometheus', async () => {
it('should return no prometheus', () => {
const endpoint = '/metrics';
mock.onGet(endpoint).reply(statusCodes.NO_CONTENT);
await testAction(
return testAction(
fetchMetrics,
{ metricsPath: endpoint, hasPrometheus: false },
{},
......@@ -64,11 +64,11 @@ describe('ServerlessActions', () => {
);
});
it('should successfully fetch metrics', async () => {
it('should successfully fetch metrics', () => {
const endpoint = '/metrics';
mock.onGet(endpoint).reply(statusCodes.OK, JSON.stringify(mockMetrics));
await testAction(
return testAction(
fetchMetrics,
{ metricsPath: endpoint, hasPrometheus: true },
{},
......
......@@ -4,28 +4,28 @@ import * as types from '~/vuex_shared/modules/modal/mutation_types';
describe('Vuex ModalModule actions', () => {
describe('open', () => {
it('works', async () => {
it('works', () => {
const data = { id: 7 };
await testAction(actions.open, data, {}, [{ type: types.OPEN, payload: data }], []);
return testAction(actions.open, data, {}, [{ type: types.OPEN, payload: data }], []);
});
});
describe('close', () => {
it('works', async () => {
await testAction(actions.close, null, {}, [{ type: types.CLOSE }], []);
it('works', () => {
return testAction(actions.close, null, {}, [{ type: types.CLOSE }], []);
});
});
describe('show', () => {
it('works', async () => {
await testAction(actions.show, null, {}, [{ type: types.SHOW }], []);
it('works', () => {
return testAction(actions.show, null, {}, [{ type: types.SHOW }], []);
});
});
describe('hide', () => {
it('works', async () => {
await testAction(actions.hide, null, {}, [{ type: types.HIDE }], []);
it('works', () => {
return testAction(actions.hide, null, {}, [{ type: types.HIDE }], []);
});
});
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment