From a4625685ec028f963d2baf32acf4f04304a45407 Mon Sep 17 00:00:00 2001 From: Alex Zherdev Date: Tue, 16 Apr 2019 09:30:50 -0700 Subject: [PATCH] Check that MIME type is present in the tests (#202) --- test.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test.js b/test.js index 7efe5588..a3d596ac 100644 --- a/test.js +++ b/test.js @@ -8,8 +8,7 @@ import fileType from '.'; const check = (ext, name) => { const file = path.join(__dirname, 'fixture', `${(name || 'fixture')}.${ext}`); - const fileInfo = fileType(readChunk.sync(file, 0, 4 + 4096)) || {}; - return fileInfo.ext; + return fileType(readChunk.sync(file, 0, 4 + 4096)) || {}; }; const types = [ @@ -195,7 +194,9 @@ const names = { }; const testFile = (t, type, name) => { - t.is(check(type, name), type); + const {ext, mime} = check(type, name); + t.is(ext, type); + t.is(typeof mime, 'string'); }; const testFileFromStream = async (t, ext, name) => {