ktongue's picture
download
raw
837 Bytes
'use strict'
const { test } = require('node:test')
const { kReplyHijacked } = require('../lib/symbols')
const wrapThenable = require('../lib/wrap-thenable')
const Reply = require('../lib/reply')
test('should resolve immediately when reply[kReplyHijacked] is true', async t => {
await new Promise(resolve => {
const reply = {}
reply[kReplyHijacked] = true
const thenable = Promise.resolve()
wrapThenable(thenable, reply)
resolve()
})
})
test('should reject immediately when reply[kReplyHijacked] is true', t => {
t.plan(1)
const reply = new Reply({}, {}, {})
reply[kReplyHijacked] = true
reply.log = {
error: ({ err }) => {
t.assert.strictEqual(err.message, 'Reply sent already')
}
}
const thenable = Promise.reject(new Error('Reply sent already'))
wrapThenable(thenable, reply)
})

Xet Storage Details

Size:
837 Bytes
·
Xet hash:
cc5a9b7adaddcad0d35ab2284bf28dc6ed6dbc0f3cd118aa7ea6d07988f9299e

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.