Skip to content

Commit

Permalink
Pass actual mock file objects from JSON spec tests instead of null
Browse files Browse the repository at this point in the history
Passing null was causing null pointer errors in the validation, which
was the source of the failing invalid SIDECAR_KEY_MISSING test.
  • Loading branch information
happy5214 committed Sep 13, 2024
1 parent a6ff876 commit 558f97e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions spec_tests/jsonTests.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand All @@ -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)]
Expand All @@ -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)]
Expand All @@ -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)]
Expand Down

0 comments on commit 558f97e

Please sign in to comment.