From 558f97ec0a77489bc8170b59e90882b8c7b111ab Mon Sep 17 00:00:00 2001 From: Alexander Jones Date: Fri, 13 Sep 2024 05:37:16 -0500 Subject: [PATCH] Pass actual mock file objects from JSON spec tests instead of null Passing null was causing null pointer errors in the validation, which was the source of the failing invalid SIDECAR_KEY_MISSING test. --- spec_tests/jsonTests.spec.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spec_tests/jsonTests.spec.js b/spec_tests/jsonTests.spec.js index 48b6cdd8..277484aa 100644 --- a/spec_tests/jsonTests.spec.js +++ b/spec_tests/jsonTests.spec.js @@ -165,14 +165,14 @@ describe('HED validation using JSON tests', () => { const mergedSide = getMergedSidecar(side, defs) let sidecarIssues = [] try { - const bidsSide = new BidsSidecar(`sidecar`, mergedSide, null) + const bidsSide = new BidsSidecar(`sidecar`, mergedSide, { relativePath: 'combo test sidecar' }) sidecarIssues = bidsSide.validate(schema) } catch (e) { sidecarIssues = [convertIssue(e)] } let eventsIssues = [] try { - const bidsTsv = new BidsTsvFile(`events`, events, null, [side], mergedSide) + const bidsTsv = new BidsTsvFile(`events`, events, { relativePath: 'combo test tsv' }, [side], mergedSide) eventsIssues = bidsTsv.validate(schema) } catch (e) { eventsIssues = [convertIssue(e)] @@ -186,7 +186,7 @@ describe('HED validation using JSON tests', () => { const header = `\n[${eCode} ${eName}](${status})\tEvents:\n"${events}"` let eventsIssues = [] try { - const bidsTsv = new BidsTsvFile(`events`, events, null, [], defs) + const bidsTsv = new BidsTsvFile(`events`, events, { relativePath: 'events test' }, [], defs) eventsIssues = bidsTsv.validate(schema) } catch (e) { eventsIssues = [convertIssue(e)] @@ -200,7 +200,7 @@ describe('HED validation using JSON tests', () => { const side1 = getMergedSidecar(side, defs) let sidecarIssues = [] try { - const bidsSide = new BidsSidecar(`sidecar`, side1, null) + const bidsSide = new BidsSidecar(`sidecar`, side1, { relativePath: 'sidecar test' }) sidecarIssues = bidsSide.validate(schema) } catch (e) { sidecarIssues = [convertIssue(e)] @@ -214,7 +214,7 @@ describe('HED validation using JSON tests', () => { const hTsv = `HED\n${str}\n` let stringIssues = [] try { - const bidsTsv = new BidsTsvFile(`events`, hTsv, null, [], defs) + const bidsTsv = new BidsTsvFile(`events`, hTsv, { relativePath: 'string test tsv' }, [], defs) stringIssues = bidsTsv.validate(schema) } catch (e) { stringIssues = [convertIssue(e)]