Fix tests

master
Paul Loyd 2017-11-05 15:39:40 +03:00
parent 3e989735ad
commit 112693ad3e
1 changed files with 7 additions and 2 deletions

View File

@ -9,8 +9,13 @@ const path = require('path');
const collect = require('..');
function run(title) {
const actual = collect(title + '.js');
const expected = JSON.parse(fs.readFileSync(title + '.json', 'utf8'));
let actual, expected;
// Run the collector only if the suite will be checked.
before(() => {
actual = collect(title + '.js');
expected = JSON.parse(fs.readFileSync(title + '.json', 'utf8'));
});
it('should provide expected schemas', () => {
assert.deepEqual(actual.schemas, expected.schemas);