Skip to content
This repository was archived by the owner on Dec 11, 2025. It is now read-only.

Commit 9a6a337

Browse files
authored
Merge pull request #1392 from nellh/issue-56-evidence
fix: Update issue 56 to provide evidence in string format
2 parents 5cd727f + 765a545 commit 9a6a337

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { checkAge89 } from '../checkAge89'
2+
3+
describe('checkAge89()', () => {
4+
it('returns evidence in the expected string format', () => {
5+
// Evidence should always be a human-readable string
6+
const issues = []
7+
const exampleParticipants = [['age'], [90]]
8+
const mockFile = {}
9+
checkAge89(exampleParticipants, mockFile, issues)
10+
expect(issues).toHaveLength(1)
11+
expect(issues[0]).toHaveProperty('evidence')
12+
expect(typeof issues[0].evidence).toBe('string')
13+
})
14+
})

bids-validator/validators/tsv/checkAge89.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const Issue = require('../../utils').issues.Issue
22

3-
const checkAge89 = function(rows, file, issues) {
3+
export const checkAge89 = function(rows, file, issues) {
44
const header = rows[0]
55
const ageIdColumn = header.indexOf('age')
66
for (let a = 0; a < rows.length; a++) {
@@ -11,7 +11,7 @@ const checkAge89 = function(rows, file, issues) {
1111
issues.push(
1212
new Issue({
1313
file: file,
14-
evidence: line,
14+
evidence: line.join(','),
1515
line: a + 1,
1616
reason: 'age of participant is above 89 ',
1717
code: 56,

0 commit comments

Comments
 (0)