Skip to content

Commit f69e47b

Browse files
authored
chore: use testcontext for busboy tests (#4572)
1 parent b7f5fca commit f69e47b

File tree

4 files changed

+8
-12
lines changed

4 files changed

+8
-12
lines changed

test/busboy/issue-3676.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use strict'
22

33
const { test } = require('node:test')
4-
const assert = require('node:assert')
54
const { Response } = require('../..')
65

76
// https://github.com/nodejs/undici/issues/3676
@@ -20,5 +19,5 @@ test('Leading and trailing CRLFs are ignored', async (t) => {
2019
}
2120
})
2221

23-
await assert.doesNotReject(response.formData())
22+
await t.assert.doesNotReject(response.formData())
2423
})

test/busboy/issue-3760.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use strict'
22

33
const { test } = require('node:test')
4-
const assert = require('node:assert')
54
const { Response } = require('../..')
65

76
// https://github.com/nodejs/undici/issues/3760
@@ -21,10 +20,10 @@ test('filename* parameter is parsed properly', async (t) => {
2120
})
2221

2322
const fd = await response.formData()
24-
assert.deepEqual(fd.get('file').name, '€ rates')
23+
t.assert.deepEqual(fd.get('file').name, '€ rates')
2524
})
2625

27-
test('whitespace after filename[*]= is ignored', async () => {
26+
test('whitespace after filename[*]= is ignored', async (t) => {
2827
for (const response of [
2928
new Response([
3029
'--83d82e0d-9ced-44c0-ac79-4e66a827415b\r\n' +
@@ -54,6 +53,6 @@ test('whitespace after filename[*]= is ignored', async () => {
5453
})
5554
]) {
5655
const fd = await response.formData()
57-
assert.deepEqual(fd.get('file').name, 'hello')
56+
t.assert.deepEqual(fd.get('file').name, 'hello')
5857
}
5958
})

test/busboy/test-types-multipart-charsets.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
'use strict'
22

3-
const assert = require('node:assert')
43
const { inspect } = require('node:util')
54
const { test } = require('node:test')
65
const { Response } = require('../..')
@@ -63,7 +62,7 @@ test('unicode filename', async (t) => {
6362
}
6463
}
6564

66-
assert.deepStrictEqual(
65+
t.assert.deepStrictEqual(
6766
results,
6867
expected,
6968
'Results mismatch.\n' +

test/busboy/test-types-multipart.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
'use strict'
22

3-
const assert = require('node:assert')
43
const { inspect } = require('node:util')
5-
const { describe } = require('node:test')
4+
const { test } = require('node:test')
65
const { Response } = require('../..')
76

87
const active = new Map()
@@ -563,7 +562,7 @@ const tests = [
563562
}
564563
]
565564

566-
describe('FormData parsing tests', async (t) => {
565+
test('FormData parsing tests', async (t) => {
567566
for (const test of tests) {
568567
active.set(test, 1)
569568

@@ -618,7 +617,7 @@ describe('FormData parsing tests', async (t) => {
618617

619618
active.delete(test)
620619

621-
assert.deepStrictEqual(
620+
t.assert.deepStrictEqual(
622621
results,
623622
test.expected,
624623
`[${what}] Results mismatch.\n` +

0 commit comments

Comments
 (0)