diff options
Diffstat (limited to 'tests/js/hero.mjs')
-rw-r--r-- | tests/js/hero.mjs | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/tests/js/hero.mjs b/tests/js/hero.mjs index 8d8f811..b183e9a 100644 --- a/tests/js/hero.mjs +++ b/tests/js/hero.mjs @@ -238,6 +238,7 @@ const test_interceptorsFn = async t => { id: "an ID", url: "a URL", method: "a method", + upgrade: true, }; assert.deepEqual( @@ -515,8 +516,9 @@ const test_wrapHandler = async t => { ]); const req = { - url: "URL", - method: "METHOD", + url: "URL", + method: "METHOD", + upgrade: false, }; assert.deepEqual( @@ -540,10 +542,11 @@ const test_wrapHandler = async t => { contents.map(o => u.dissoc(o, "timings")), [ { - id: "0", - url: "URL", - method: "METHOD", - type: "in-request", + id: "0", + url: "URL", + method: "METHOD", + type: "in-request", + upgrade: false, }, { id: "0", @@ -1096,6 +1099,8 @@ const test_handleRequest = async t => { a: "1", b: "two", }, + upgrade: false, + socket: null, }; assert.deepEqual( @@ -1115,6 +1120,8 @@ const test_handleRequest = async t => { }, ref: req, handler: fn, + upgrade: false, + socket: null, }, ); }); @@ -1160,6 +1167,8 @@ const test_handleRequest = async t => { }, handler: fn, ref: req, + upgrade: true, + socket: fn, }, ); }); @@ -1700,7 +1709,7 @@ const test_makeReopeningPipeReader = async t => { fs.createWriteStream(path).end().close(); pipe.ref.on("close", () => { assert.deepEqual(lines, []); - assert.deepEqual(logs, [{ + assert.deepEqual(logs, [{ message: "pipe closed, NOT reopening", }]); @@ -1715,8 +1724,8 @@ const test_makeReopeningPipeReader = async t => { const shouldReopenPipe = { ref: true }; const lines = []; const logs = []; - const lineFn = x => lines.push(x); - const logger = { debug: x => logs.push(x) }; + const lineFn = x => lines.push(x); + const logger = { debug: x => logs.push(x) }; const previous = process.env.DEBUG; delete process.env.DEBUG; |