flaska/test/fileResponse.test.mjs
Jonatan Nilsson cfd56f83ae
All checks were successful
continuous-integration/appveyor/branch AppVeyor build succeeded
requestEnd: Now properly supports ctx.headers and properly sends all headers to res with status code using writeHead
FileResponse: Initial development started to serve files
2022-03-25 13:26:13 +00:00

19 lines
547 B
JavaScript

import { Eltro as t, assert, stub } from 'eltro'
import { FileResponse } from '../flaska.mjs'
t.test('should add path and stat', function() {
const assertPath = 'some/path/here'
const assertStat = { a: 1 }
let fileRes = new FileResponse(assertPath, assertStat)
assert.strictEqual(fileRes.filepath, assertPath)
assert.strictEqual(fileRes.stat, assertStat)
})
t.describe('CreateReader()', function() {
t.test('should return fileReader for file with correct seeking', function() {
const stubCreateReadStream = stub()
})
})