Tweak formatting
This commit is contained in:
parent
f91bf5abd7
commit
dc1af59fa1
server/middleware
|
@ -4,7 +4,14 @@ const mime = require('mime')
|
|||
const TextFiles = /\/?(\.[a-z]*rc|\.git[a-z]*|\.[a-z]*ignore)$/i
|
||||
|
||||
mime.define({
|
||||
'text/plain': ['license', 'readme', 'changes', 'authors', 'makefile', 'ts'],
|
||||
'text/plain': [
|
||||
'license',
|
||||
'readme',
|
||||
'changes',
|
||||
'authors',
|
||||
'makefile',
|
||||
'ts'
|
||||
]
|
||||
})
|
||||
|
||||
const getContentType = (file) =>
|
||||
|
|
|
@ -1,30 +1,30 @@
|
|||
const { getContentType, getStats, getFileType } = require('./FileUtils');
|
||||
const { getContentType, getStats, getFileType } = require('./FileUtils')
|
||||
|
||||
it('gets a contextType of text/plain for LICENSE|README|CHANGES|AUTHORS|Makefile', () => {
|
||||
expect(getContentType('LICENSE')).toBe('text/plain');
|
||||
expect(getContentType('README')).toBe('text/plain');
|
||||
expect(getContentType('CHANGES')).toBe('text/plain');
|
||||
expect(getContentType('AUTHORS')).toBe('text/plain');
|
||||
expect(getContentType('Makefile')).toBe('text/plain');
|
||||
});
|
||||
it('gets a content type of text/plain for LICENSE|README|CHANGES|AUTHORS|Makefile', () => {
|
||||
expect(getContentType('LICENSE')).toBe('text/plain')
|
||||
expect(getContentType('README')).toBe('text/plain')
|
||||
expect(getContentType('CHANGES')).toBe('text/plain')
|
||||
expect(getContentType('AUTHORS')).toBe('text/plain')
|
||||
expect(getContentType('Makefile')).toBe('text/plain')
|
||||
})
|
||||
|
||||
it('gets a contextType of text/plain for .*rc files', () => {
|
||||
expect(getContentType('.eslintrc')).toBe('text/plain');
|
||||
expect(getContentType('.babelrc')).toBe('text/plain');
|
||||
expect(getContentType('.anythingrc')).toBe('text/plain');
|
||||
});
|
||||
it('gets a content type of text/plain for .*rc files', () => {
|
||||
expect(getContentType('.eslintrc')).toBe('text/plain')
|
||||
expect(getContentType('.babelrc')).toBe('text/plain')
|
||||
expect(getContentType('.anythingrc')).toBe('text/plain')
|
||||
})
|
||||
|
||||
it('gets a contextType of text/plain for .git* files', () => {
|
||||
expect(getContentType('.gitignore')).toBe('text/plain');
|
||||
expect(getContentType('.gitanything')).toBe('text/plain');
|
||||
});
|
||||
it('gets a content type of text/plain for .git* files', () => {
|
||||
expect(getContentType('.gitignore')).toBe('text/plain')
|
||||
expect(getContentType('.gitanything')).toBe('text/plain')
|
||||
})
|
||||
|
||||
it('gets a contextType of text/plain for .*ignore files', () => {
|
||||
expect(getContentType('.eslintignore')).toBe('text/plain');
|
||||
expect(getContentType('.anythingignore')).toBe('text/plain');
|
||||
});
|
||||
it('gets a content type of text/plain for .*ignore files', () => {
|
||||
expect(getContentType('.eslintignore')).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');
|
||||
});
|
||||
it('gets a content type 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