mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-16 21:00:40 -07:00
Changes including: - will not call fs.resolve when normalizing `fs` - removed hardcoded `/` - mandatory `fs.dirname` for relative reference - mandatory `fs.sep`, defaults to '/'
This commit is contained in:
@@ -12,5 +12,15 @@ describe('fs/loader', function () {
|
||||
const candidates = [...loader.candidates('./foo/bar', ['/root', '/root/foo'], '/root/current', true)]
|
||||
expect(candidates).to.contain('/root/foo/bar')
|
||||
})
|
||||
it('should not include out of root candidates', async function () {
|
||||
const loader = new Loader({ relativeReference: true, fs, extname: '' } as any)
|
||||
const candidates = [...loader.candidates('../foo/bar', ['/root'], '/root/current', true)]
|
||||
expect(candidates).to.have.lengthOf(0)
|
||||
})
|
||||
it('should treat root as a terminated path', async function () {
|
||||
const loader = new Loader({ relativeReference: true, fs, extname: '' } as any)
|
||||
const candidates = [...loader.candidates('../root-dir/bar', ['/root'], '/root/current', true)]
|
||||
expect(candidates).to.have.lengthOf(0)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user