Skip to content
Snippets Groups Projects
Commit 3671e7fb authored by Ole Langbehn's avatar Ole Langbehn
Browse files

deno fmt

parent 8bf5cda4
No related branches found
No related tags found
No related merge requests found
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',
})
},
)
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment