mirror of
https://github.com/scratchfoundation/scratch-analysis.git
synced 2024-12-01 03:46:50 -05:00
24 lines
582 B
JavaScript
24 lines
582 B
JavaScript
const fs = require('fs');
|
|
const path = require('path');
|
|
const test = require('tap').test;
|
|
const analysis = require('../../lib/index');
|
|
|
|
const invalidBinary = fs.readFileSync(
|
|
path.resolve(__dirname, '../fixtures/invalid/garbage.jpg')
|
|
);
|
|
|
|
test('invalid object', t => {
|
|
analysis('{}', (err, result) => {
|
|
t.type(err, 'object');
|
|
t.type(result, 'undefined');
|
|
t.end();
|
|
});
|
|
});
|
|
|
|
test('invalid binary', t => {
|
|
analysis(invalidBinary, (err, result) => {
|
|
t.type(err, 'string');
|
|
t.type(result, 'undefined');
|
|
t.end();
|
|
});
|
|
});
|