diff --git a/test/parallel/test-http-client-unescaped-path.js b/test/parallel/test-http-client-unescaped-path.js index 2411d0e6be31e2..1a74943e838259 100644 --- a/test/parallel/test-http-client-unescaped-path.js +++ b/test/parallel/test-http-client-unescaped-path.js @@ -3,12 +3,8 @@ const common = require('../common'); const assert = require('assert'); const http = require('http'); -function* bad() { - for (let i = 0; i <= 32; i += 1) - yield 'bad' + String.fromCharCode(i) + 'path'; -} - -for (const path of bad()) { +for (let i = 0; i <= 32; i += 1) { + const path = 'bad' + String.fromCharCode(i) + 'path'; assert.throws(() => http.get({ path }, common.fail), /contains unescaped characters/); }