Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
2713ddb6
Commit
2713ddb6
authored
Apr 13, 2022
by
Justin Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use return instead of using async / await
parent
87d28bea
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
16 deletions
+16
-16
spec/frontend/serverless/store/actions_spec.js
spec/frontend/serverless/store/actions_spec.js
+8
-8
spec/frontend/vuex_shared/modules/modal/actions_spec.js
spec/frontend/vuex_shared/modules/modal/actions_spec.js
+8
-8
No files found.
spec/frontend/serverless/store/actions_spec.js
View file @
2713ddb6
...
...
@@ -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
},
{},
...
...
spec/frontend/vuex_shared/modules/modal/actions_spec.js
View file @
2713ddb6
...
...
@@ -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
}],
[]);
});
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment