mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-20 06:07:55 +00:00
28 lines
532 B
CoffeeScript
28 lines
532 B
CoffeeScript
expect = require('chai').expect
|
|
fsUtils = require('./fs-utils')
|
|
|
|
describe 'FsUtils:', ->
|
|
|
|
describe '#isValidPath()', ->
|
|
|
|
it 'should return false for invalid paths', ->
|
|
|
|
for invalidPath in [
|
|
{ hello: 'world' }
|
|
1234
|
|
[ 1, 2, 3 ]
|
|
undefined
|
|
null
|
|
]
|
|
expect(fsUtils.isValidPath(invalidPath)).to.be.false
|
|
|
|
it 'should return true for valid paths', ->
|
|
|
|
for validPath in [
|
|
'/Users/johndoe'
|
|
'~/.resin'
|
|
'../parent'
|
|
'./file/../file2'
|
|
]
|
|
expect(fsUtils.isValidPath(validPath)).to.be.true
|