UNPKG

731 BJavaScriptView Raw
1import chai from 'chai'
2import { extend, normalize_asset_path } from './../source/common'
3
4import path from 'path'
5
6chai.should()
7
8describe('common functions', function()
9{
10 it('should normalize asset paths', function()
11 {
12 const project_folder = path.join(__dirname, 'project')
13
14 normalize_asset_path(path.join(project_folder, 'folder/file.txt'), project_folder).should.equal('./folder/file.txt')
15 // normalize_asset_path(path.join(project_folder, '../another/folder/file.txt'), project_folder).should.equal(path.join(project_folder, '../another/folder/file.txt'))
16 normalize_asset_path(path.join(project_folder, '../another/folder/file.txt'), project_folder).should.equal('../another/folder/file.txt')
17 })
18})
\No newline at end of file