Skip to content

Commit 7f0615d

Browse files
committed
fix: Accommodate picker deep-equality checker
1 parent 5fccdab commit 7f0615d

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/files/browser.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ import { FileIgnoreRules } from './ignore.ts'
22
import { FileTree } from '../types/filetree.ts'
33
import { assertEquals, assertObjectMatch } from '@std/assert'
44
import { BIDSFileBrowser, fileListToTree } from './browser.ts'
5+
import { streamFromString } from '../tests/utils.ts'
6+
7+
const nullstream = streamFromString('')
58

69
class TestFile extends File {
710
override webkitRelativePath: string
@@ -13,6 +16,7 @@ class TestFile extends File {
1316
) {
1417
super(fileBits, fileName, options)
1518
this.webkitRelativePath = webkitRelativePath
19+
this.stream = () => nullstream
1620
}
1721
}
1822

@@ -79,7 +83,7 @@ Deno.test('Browser implementation of FileTree', async (t) => {
7983
})
8084

8185
await t.step('reads .bidsignore during load', async () => {
82-
const ignore = new FileIgnoreRules([])
86+
const ignore = new FileIgnoreRules(['ignored_but_absent', 'ignored_and_present'])
8387
const files = [
8488
new TestFile(
8589
['ignored_but_absent\n', 'ignored_and_present\n'],

src/types/filetree.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export class FileTree {
4646
}
4747

4848
get ignored(): boolean {
49+
if (!this.parent) { return false }
4950
return this.#ignore.test(this.path)
5051
}
5152

0 commit comments

Comments
 (0)