Skip to content

Commit

Permalink
test(legacy): Call isdone() unconditionally
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Oct 30, 2024
1 parent 66d6fc1 commit 519642e
Showing 1 changed file with 18 additions and 19 deletions.
37 changes: 18 additions & 19 deletions bids-validator/tests/bids.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ describe('BIDS example datasets ', function () {
} else {
assert.deepEqual(session_flag, true)
}
isdone()
},
)
isdone()
})
})
})
Expand All @@ -113,9 +113,9 @@ describe('BIDS example datasets ', function () {
warnings.findIndex((warning) => warning.code === 13) > -1,
'warnings do not contain a code 13',
)
isdone()
},
)
isdone()
})

// we need to have at least one non-dynamic test
Expand Down Expand Up @@ -147,9 +147,9 @@ describe('BIDS example datasets ', function () {
participantId: '01',
sex: 'M',
})
isdone()
},
)
isdone()
})

// test for duplicate files present with both .nii and .nii.gz extension
Expand All @@ -159,16 +159,16 @@ describe('BIDS example datasets ', function () {
enableNiftiHeaders,
function (issues) {
assertErrorCode(issues.errors, 74)
isdone()
},
)
isdone()
})

it('includes issue 53 NO_T1W for dataset without T1w files', function (isdone) {
validate.BIDS(createDatasetFileList('no_t1w'), options, function (issues) {
assertErrorCode(issues.ignored, 53)
isdone()
})
isdone()
})

// test for illegal characters used in acq and task name
Expand All @@ -178,9 +178,9 @@ describe('BIDS example datasets ', function () {
enableNiftiHeaders,
function (issues) {
assertErrorCode(issues.errors, 58)
isdone()
},
)
isdone()
})

// test for illegal characters used in sub name
Expand All @@ -190,9 +190,9 @@ describe('BIDS example datasets ', function () {
enableNiftiHeaders,
function (issues) {
assertErrorCode(issues.errors, 64)
isdone()
},
)
isdone()
})

it('checks for subjects with no valid data', function (isdone) {
Expand All @@ -201,9 +201,9 @@ describe('BIDS example datasets ', function () {
options,
function (issues) {
assertErrorCode(issues.errors, 67)
isdone()
},
)
isdone()
})

it('validates MRI modalities', function (isdone) {
Expand All @@ -224,9 +224,9 @@ describe('BIDS example datasets ', function () {
warnings.findIndex((warning) => warning.code === 13) > -1,
'warnings do not contain a code 13',
)
isdone()
},
)
isdone()
})

it('blacklists modalities specified', function (isdone) {
Expand All @@ -252,10 +252,9 @@ describe('BIDS example datasets ', function () {
errors.findIndex((error) => error.code === 139) > -1,
'errors do contain a code 139',
)

isdone()
},
)
isdone()
})

it('checks for data dictionaries without corresponding data files', function (isdone) {
Expand All @@ -267,9 +266,9 @@ describe('BIDS example datasets ', function () {
issues.errors.findIndex((issue) => issue.code === 90),
-1,
)
isdone()
},
)
isdone()
})

it('checks for fieldmaps with no _magnitude file', function (isdone) {
Expand All @@ -281,9 +280,9 @@ describe('BIDS example datasets ', function () {
issues.errors.findIndex((issue) => issue.code === 91),
-1,
)
isdone()
},
)
isdone()
})

it('should not throw a warning if all _phasediff.nii are associated with _magnitude1.nii', function (isdone) {
Expand All @@ -292,9 +291,9 @@ describe('BIDS example datasets ', function () {
options,
function (issues) {
assert.deepEqual(issues.errors, [])
isdone()
},
)
isdone()
})

it('should throw a warning if there are _phasediff.nii without an associated _magnitude1.nii', function (isdone) {
Expand All @@ -303,9 +302,9 @@ describe('BIDS example datasets ', function () {
options,
function (issues) {
assert.notEqual(issues.warnings.findIndex((issue) => issue.code === 92))
isdone()
},
)
isdone()
})

it('should not throw an error if it encounters no non-utf-8 files', function (isdone) {
Expand All @@ -317,9 +316,9 @@ describe('BIDS example datasets ', function () {
issues.errors.findIndex((issue) => issue.code === 123),
-1,
)
isdone()
},
)
isdone()
})

it('should validate pet data', function (isdone) {
Expand All @@ -328,9 +327,9 @@ describe('BIDS example datasets ', function () {
options,
function (issues) {
assertErrorCode(issues.errors, 55)
isdone()
},
)
isdone()
})

it('should validate pet blood data', function (isdone) {
Expand All @@ -339,9 +338,9 @@ describe('BIDS example datasets ', function () {
options,
function (issues) {
assertErrorCode(issues.errors, 55)
isdone()
},
)
isdone()
})

it('should catch missing tsv columns', function (isdone) {
Expand All @@ -350,8 +349,8 @@ describe('BIDS example datasets ', function () {
options,
function (issues) {
assertErrorCode(issues.errors, 211)
isdone()
},
)
isdone()
})
})

0 comments on commit 519642e

Please sign in to comment.