Skip to content

Commit

Permalink
Remove the false false positive tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Borewit committed Aug 25, 2020
1 parent 804159a commit 648e210
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,6 @@ const names = {
]
};

// Define an entry here only if the file type has potential
// for false-positives
const falsePositives = {
};

// Known failing fixture
const failingFixture = [
'fixture.asf'
Expand Down Expand Up @@ -215,15 +210,6 @@ async function testFromBuffer(t, ext, name) {
await checkBufferLike(t, ext, chunk.buffer.slice(chunk.byteOffset, chunk.byteOffset + chunk.byteLength));
}

async function testFalsePositive(t, ext, name) {
const file = path.join(__dirname, 'fixture', `${name}.${ext}`);
const chunk = fs.readFileSync(file);

t.is(await FileType.fromBuffer(chunk), undefined);
t.is(await FileType.fromBuffer(new Uint8Array(chunk)), undefined);
t.is(await FileType.fromBuffer(chunk.buffer), undefined);
}

async function testFileFromStream(t, ext, name) {
const filename = `${(name || 'fixture')}.${ext}`;
const file = path.join(__dirname, 'fixture', filename);
Expand Down Expand Up @@ -277,12 +263,6 @@ for (const type of types) {
_test(`${type} ${i++} .fromStream()`, testFileFromStream, type);
test(`${type} ${i++} .stream() - identical streams`, testStream, type);
}

if (Object.prototype.hasOwnProperty.call(falsePositives, type)) {
for (const falsePositiveFile of falsePositives[type]) {
test(`false positive - ${type} ${i++}`, testFalsePositive, type, falsePositiveFile);
}
}
}

test('.stream() method - empty stream', async t => {
Expand Down

0 comments on commit 648e210

Please sign in to comment.