-
-
Notifications
You must be signed in to change notification settings - Fork 794
/
provided.al2.test.js
38 lines (33 loc) · 895 Bytes
/
provided.al2.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import assert from 'node:assert'
import { env } from 'node:process'
import { join } from 'desm'
import { setup, teardown } from '../../../_testHelpers/index.js'
import { BASE_URL } from '../../../config.js'
describe('Go via provided.al2 with GoRunner', function desc() {
beforeEach(() =>
setup({
servicePath: join(import.meta.url),
}),
)
afterEach(() => teardown())
//
;[
{
description: 'should work with provided.al2',
expected: {
message: 'Hello Go on provided.al2!',
},
path: '/dev/hello',
},
].forEach(({ description, expected, path }) => {
it(description, async function it() {
if (!env.GO1X_DETECTED) {
this.skip()
}
const url = new URL(path, BASE_URL)
const response = await fetch(url)
const json = await response.json()
assert.deepEqual(json, expected)
})
})
})