Manually set mime type for TypeScript files
This commit is contained in:
parent
c68dac5f33
commit
f91bf5abd7
|
@ -4,7 +4,7 @@ const mime = require('mime')
|
||||||
const TextFiles = /\/?(\.[a-z]*rc|\.git[a-z]*|\.[a-z]*ignore)$/i
|
const TextFiles = /\/?(\.[a-z]*rc|\.git[a-z]*|\.[a-z]*ignore)$/i
|
||||||
|
|
||||||
mime.define({
|
mime.define({
|
||||||
'text/plain': ['license', 'readme', 'changes', 'authors', 'makefile'],
|
'text/plain': ['license', 'readme', 'changes', 'authors', 'makefile', 'ts'],
|
||||||
})
|
})
|
||||||
|
|
||||||
const getContentType = (file) =>
|
const getContentType = (file) =>
|
||||||
|
|
|
@ -22,4 +22,9 @@ it('gets a contextType of text/plain for .git* files', () => {
|
||||||
it('gets a contextType of text/plain for .*ignore files', () => {
|
it('gets a contextType of text/plain for .*ignore files', () => {
|
||||||
expect(getContentType('.eslintignore')).toBe('text/plain');
|
expect(getContentType('.eslintignore')).toBe('text/plain');
|
||||||
expect(getContentType('.anythingignore')).toBe('text/plain');
|
expect(getContentType('.anythingignore')).toBe('text/plain');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('gets a contextType of text/plain for .ts files', () => {
|
||||||
|
expect(getContentType('app.ts')).toBe('text/plain');
|
||||||
|
expect(getContentType('app.d.ts')).toBe('text/plain');
|
||||||
});
|
});
|
Loading…
Reference in New Issue