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', () => { ...@@ -18,11 +18,11 @@ describe('ServerlessActions', () => {
}); });
describe('fetchFunctions', () => { describe('fetchFunctions', () => {
it('should successfully fetch functions', async () => { it('should successfully fetch functions', () => {
const endpoint = '/functions'; const endpoint = '/functions';
mock.onGet(endpoint).reply(statusCodes.OK, JSON.stringify(mockServerlessFunctions)); mock.onGet(endpoint).reply(statusCodes.OK, JSON.stringify(mockServerlessFunctions));
await testAction( return testAction(
fetchFunctions, fetchFunctions,
{ functionsPath: endpoint }, { functionsPath: endpoint },
{}, {},
...@@ -34,13 +34,13 @@ describe('ServerlessActions', () => { ...@@ -34,13 +34,13 @@ describe('ServerlessActions', () => {
); );
}); });
it('should successfully retry', async () => { it('should successfully retry', () => {
const endpoint = '/functions'; const endpoint = '/functions';
mock mock
.onGet(endpoint) .onGet(endpoint)
.reply(() => new Promise((resolve) => setTimeout(() => resolve(200), Infinity))); .reply(() => new Promise((resolve) => setTimeout(() => resolve(200), Infinity)));
await testAction( return testAction(
fetchFunctions, fetchFunctions,
{ functionsPath: endpoint }, { functionsPath: endpoint },
{}, {},
...@@ -51,11 +51,11 @@ describe('ServerlessActions', () => { ...@@ -51,11 +51,11 @@ describe('ServerlessActions', () => {
}); });
describe('fetchMetrics', () => { describe('fetchMetrics', () => {
it('should return no prometheus', async () => { it('should return no prometheus', () => {
const endpoint = '/metrics'; const endpoint = '/metrics';
mock.onGet(endpoint).reply(statusCodes.NO_CONTENT); mock.onGet(endpoint).reply(statusCodes.NO_CONTENT);
await testAction( return testAction(
fetchMetrics, fetchMetrics,
{ metricsPath: endpoint, hasPrometheus: false }, { metricsPath: endpoint, hasPrometheus: false },
{}, {},
...@@ -64,11 +64,11 @@ describe('ServerlessActions', () => { ...@@ -64,11 +64,11 @@ describe('ServerlessActions', () => {
); );
}); });
it('should successfully fetch metrics', async () => { it('should successfully fetch metrics', () => {
const endpoint = '/metrics'; const endpoint = '/metrics';
mock.onGet(endpoint).reply(statusCodes.OK, JSON.stringify(mockMetrics)); mock.onGet(endpoint).reply(statusCodes.OK, JSON.stringify(mockMetrics));
await testAction( return testAction(
fetchMetrics, fetchMetrics,
{ metricsPath: endpoint, hasPrometheus: true }, { metricsPath: endpoint, hasPrometheus: true },
{}, {},
......
...@@ -4,28 +4,28 @@ import * as types from '~/vuex_shared/modules/modal/mutation_types'; ...@@ -4,28 +4,28 @@ import * as types from '~/vuex_shared/modules/modal/mutation_types';
describe('Vuex ModalModule actions', () => { describe('Vuex ModalModule actions', () => {
describe('open', () => { describe('open', () => {
it('works', async () => { it('works', () => {
const data = { id: 7 }; 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', () => { describe('close', () => {
it('works', async () => { it('works', () => {
await testAction(actions.close, null, {}, [{ type: types.CLOSE }], []); return testAction(actions.close, null, {}, [{ type: types.CLOSE }], []);
}); });
}); });
describe('show', () => { describe('show', () => {
it('works', async () => { it('works', () => {
await testAction(actions.show, null, {}, [{ type: types.SHOW }], []); return testAction(actions.show, null, {}, [{ type: types.SHOW }], []);
}); });
}); });
describe('hide', () => { describe('hide', () => {
it('works', async () => { it('works', () => {
await testAction(actions.hide, null, {}, [{ type: types.HIDE }], []); 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