fix(core): update
This commit is contained in:
14
test/test.ts
14
test/test.ts
@ -1,45 +1,45 @@
|
||||
import { expect, tap } from '@pushrocks/tapbundle';
|
||||
import * as smartmime from '../ts/index';
|
||||
import * as smartmime from '../ts/index.js';
|
||||
|
||||
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;
|
||||
expect(smartmime.isBinary(filePath)).toBeTrue();
|
||||
});
|
||||
|
||||
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;
|
||||
expect(smartmime.isBinary(filePath)).toBeFalse();
|
||||
});
|
||||
|
||||
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;
|
||||
expect(smartmime.isBinary(filePath)).toBeFalse();
|
||||
});
|
||||
|
||||
tap.test('should detect html', async () => {
|
||||
const filePath = 'file.html';
|
||||
const fileType = smartmime.detectMimeType(filePath);
|
||||
expect(fileType).to.equal('text/html');
|
||||
expect(fileType).toEqual('text/html');
|
||||
console.log(fileType);
|
||||
});
|
||||
|
||||
tap.test('should detect woff', async () => {
|
||||
const filePath = 'file.woff';
|
||||
const fileType = smartmime.detectMimeType(filePath);
|
||||
expect(fileType).to.equal('font/woff');
|
||||
expect(fileType).toEqual('font/woff');
|
||||
console.log(fileType);
|
||||
});
|
||||
|
||||
tap.test('should detect woff2', async () => {
|
||||
const filePath = 'file.woff2';
|
||||
const fileType = smartmime.detectMimeType(filePath);
|
||||
expect(fileType).to.equal('font/woff2');
|
||||
expect(fileType).toEqual('font/woff2');
|
||||
console.log(fileType);
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user