Skip to content
Myr

tests: add maxAge option tests for res.sendFile

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Douglas Christopher Wilson · committed by Douglas Christopher Wilson · parent 7154014 · Browse files · 1 file+24 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+24 added−0 removed

  • tests:+24 added−0 removed

1 file+24 added−0 removed

modified:test/res.sendFile.js+24 added
178 unmodified lines
179 .expect(404, done);180 });181 });182183 describe('with "maxAge" option', function () {184 it('should set cache-control max-age from number', function (done) {185 var app = createApp(path.resolve(__dirname, 'fixtures/name.txt'), {186 maxAge: 14400000187 })188189 request(app)190 .get('/')191 .expect('Cache-Control', 'public, max-age=14400')192 .expect(200, done)193 })194195 it('should set cache-control max-age from string', function (done) {196 var app = createApp(path.resolve(__dirname, 'fixtures/name.txt'), {197 maxAge: '4h'198 })199200 request(app)201 .get('/')202 .expect('Cache-Control', 'public, max-age=14400')203 .expect(200, done)204 })205 })206207 describe('with "root" option', function () {208 it('should not transfer relative with without', function (done) {209 var app = createApp('test/fixtures/name.txt');210
565 unmodified lines