fix(core): update

This commit is contained in:
2020-03-04 14:21:44 +00:00
commit 3a067a7aae
13 changed files with 2074 additions and 0 deletions

31
test/test.ts Normal file
View File

@ -0,0 +1,31 @@
import { expect, tap } from '@pushrocks/tapbundle';
import * as smartmime from '../ts/index';
tap.test('should detect image', async () => {
const filePath = 'file.jpg';
const fileType = smartmime.detectMimeType(filePath);
console.log(fileType);
expect(smartmime.isBinary(filePath)).to.be.true;
});
tap.test('should detect text', async () => {
const filePath = 'file.svg';
const fileType = smartmime.detectMimeType(filePath);
console.log(fileType);
expect(smartmime.isBinary(filePath)).to.be.false;
});
tap.test('should detect json', async () => {
const filePath = 'file.json';
const fileType = smartmime.detectMimeType(filePath);
console.log(fileType);
expect(smartmime.isBinary(filePath)).to.be.false;
});
tap.test('should detect html', async () => {
const filePath = 'file.html';
const fileType = smartmime.detectMimeType(filePath);
console.log(fileType);
});
tap.start();