test: coverage to 100%

This commit is contained in:
Harttle
2021-12-07 23:34:53 +08:00
committed by Harttle
parent 6c114267a5
commit 69286c6909
6 changed files with 62 additions and 25 deletions
+9
View File
@@ -22,5 +22,14 @@ describe('fs/loader', function () {
const candidates = [...loader.candidates('../root-dir/bar', ['/root'], '/root/current', true)]
expect(candidates).to.have.lengthOf(0)
})
it('should default `.contains()` to () => true', async function () {
const customFs = {
...fs,
contains: undefined
}
const loader = new Loader({ relativeReference: true, fs: customFs, extname: '' } as any)
const candidates = [...loader.candidates('../foo/bar', ['/root'], '/root/current', true)]
expect(candidates).to.contain('/foo/bar')
})
})
})