Skip to content

Commit

Permalink
fix(test): Use join for FileTree path
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Jun 8, 2024
1 parent 7749bf0 commit 70ae314
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bids-validator/src/files/browser.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { FileIgnoreRules } from './ignore.ts'
import { FileTree } from '../types/filetree.ts'
import { join } from '../deps/path.ts'
import { assertEquals, assertObjectMatch } from '../deps/asserts.ts'
import { BIDSFileBrowser, fileListToTree } from './browser.ts'

Expand Down Expand Up @@ -59,7 +60,7 @@ Deno.test('Browser implementation of FileTree', async (t) => {
const tree = await fileListToTree(files)
const expectedTree = new FileTree('', '/', undefined)
const sub01Tree = new FileTree('sub-01', 'sub-01', expectedTree)
const anatTree = new FileTree('sub-01/anat', 'anat', sub01Tree)
const anatTree = new FileTree(join('sub-01', 'anat'), 'anat', sub01Tree)
expectedTree.files = files
.slice(0, 3)
.map((f) => new BIDSFileBrowser(f, ignore))
Expand All @@ -86,4 +87,4 @@ Deno.test("Spread copies of BIDSFileBrowser contain name and path properties", a
assertEquals(tree, expectedTree)
const spreadFile = {...expectedTree.files[0], evidence: "test evidence"}
assertObjectMatch(spreadFile, {name: "dataset_description.json", path: "/dataset_description.json", evidence: "test evidence"})
})
})

0 comments on commit 70ae314

Please sign in to comment.