Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
holi-geo-api
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Operate
Terraform modules
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
app
holi-geo-api
Commits
3671e7fb
Commit
3671e7fb
authored
6 months ago
by
Ole Langbehn
Browse files
Options
Downloads
Patches
Plain Diff
deno fmt
parent
8bf5cda4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
smoketest/main.js
+13
-11
13 additions, 11 deletions
smoketest/main.js
with
13 additions
and
11 deletions
smoketest/main.js
+
13
−
11
View file @
3671e7fb
import
http
from
'
k6/http
'
import
http
from
'
k6/http
'
import
{
check
,
sleep
}
from
'
k6
'
import
{
check
,
sleep
}
from
'
k6
'
// You don't need to change anything in this section, it's k6 glue code.
// You don't need to change anything in this section, it's k6 glue code.
// See the default function at the end of the file for defining your smoketest.
// See the default function at the end of the file for defining your smoketest.
// This configuration only executes 1 test, enough for a smoketest. The smoketest will fail on any check failing.
// This configuration only executes 1 test, enough for a smoketest. The smoketest will fail on any check failing.
...
@@ -28,14 +27,17 @@ function forQuery(query, checkFunction) {
...
@@ -28,14 +27,17 @@ function forQuery(query, checkFunction) {
// Define your smoketest(s) here.
// Define your smoketest(s) here.
export
default
()
=>
{
export
default
()
=>
{
forQuery
(
`{placeDetails(id:"51223999b85500244059f052ea9271c64a40f00101f9013ef5000000000000c00208"){name}}`
,
(
response
)
=>
{
forQuery
(
check
(
response
,
{
`{placeDetails(id:"51223999b85500244059f052ea9271c64a40f00101f9013ef5000000000000c00208"){name}}`
,
'
is status 200
'
:
(
r
)
=>
r
.
status
===
200
,
(
response
)
=>
{
})
check
(
response
,
{
check
(
JSON
.
parse
(
response
.
body
),
{
'
is status 200
'
:
(
r
)
=>
r
.
status
===
200
,
// there can be multiple tests here, e.g.
})
//"contains topics object": (r) => typeof r.data.topics != null,
check
(
JSON
.
parse
(
response
.
body
),
{
'
returns name for place
'
:
(
r
)
=>
typeof
r
.
data
.
placeDetails
.
name
===
"
string
"
,
// there can be multiple tests here, e.g.
})
//"contains topics object": (r) => typeof r.data.topics != null,
})
'
returns name for place
'
:
(
r
)
=>
typeof
r
.
data
.
placeDetails
.
name
===
'
string
'
,
})
},
)
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment