mirror of
https://github.com/scratchfoundation/scratch-parser.git
synced 2025-07-03 18:10:34 -04:00
Refactors library to use latest scratch eslint rules. Updates all dependencies to latest versions which requires minor changes to the JSON schema, tests, and supported engine (8+) BREAKING CHANGE: Module no longer supports less than Node 8
26 lines
596 B
JavaScript
26 lines
596 B
JavaScript
var test = require('tap').test;
|
|
var parse = require('../../lib/parse');
|
|
var data = require('../fixtures/data');
|
|
|
|
test('spec', function (t) {
|
|
t.type(parse, 'function');
|
|
t.end();
|
|
});
|
|
|
|
test('valid', function (t) {
|
|
for (var i = 0; i < data.json.length; i++) {
|
|
parse(data.json[i].toString(), function (err, res) {
|
|
t.equal(err, null);
|
|
t.type(res, 'object');
|
|
});
|
|
}
|
|
t.end();
|
|
});
|
|
|
|
test('invalid', function (t) {
|
|
parse('&%@', function (err, res) {
|
|
t.type(err, 'string');
|
|
t.type(res, 'undefined');
|
|
t.end();
|
|
});
|
|
});
|