Skip to content

Commit 1219602

Browse files
committed
test: improve assertions to work cross platform
1 parent 2cd997e commit 1219602

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

tests/request.spec.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -380,9 +380,7 @@ test.group('Request', () => {
380380
})
381381

382382
const { body } = await supertest(url).get('/')
383-
assert.deepEqual(body, {
384-
ip: '::1',
385-
})
383+
assert.oneOf(body.ip, ['::1', '127.0.0.1'])
386384
})
387385

388386
test('get ip addresses as an array', async ({ assert }) => {
@@ -394,9 +392,7 @@ test.group('Request', () => {
394392
})
395393

396394
const { body } = await supertest(url).get('/')
397-
assert.deepEqual(body, {
398-
ip: ['::1'],
399-
})
395+
body.ip.map((ip: string) => assert.oneOf(ip, ['::1', '127.0.0.1']))
400396
})
401397

402398
test('get request protocol', async ({ assert }) => {

0 commit comments

Comments
 (0)