Skip to content

Commit

Permalink
Test mime-types
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudBuchholz committed May 25, 2021
1 parent 175542c commit caf8f67
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/mocha/handlers/file.test.js
Expand Up @@ -830,4 +830,24 @@ describe('handlers/file', () => {
))
})
})

describe('mime-types', () => {
it('overrides default mime types', () => handle({
request: {
method: 'GET',
url: './file.txt',
},
mapping: {
'mime-types': {
txt: 'not-even-existing'
}
}
})
.then(({ promise, response }) => promise.then(value => {
assert(() => value === undefined)
assert(() => response.statusCode === 200)
assert(() => response.headers['Content-Type'] === 'not-even-existing')
}))
)
})
})

0 comments on commit caf8f67

Please sign in to comment.