2018-06-28 23:26:08 +00:00
|
|
|
var Path = require('../../src').Path;
|
2015-06-29 15:38:51 +00:00
|
|
|
var expect = require('chai').expect;
|
|
|
|
|
|
|
|
describe('Path.resolve does not work, issue357', function() {
|
|
|
|
it('Path.relative() should not crash', function() {
|
2018-07-15 17:25:35 +00:00
|
|
|
expect(Path.relative('/mydir', '/mydir/file')).to.equal('file');
|
2015-06-29 15:38:51 +00:00
|
|
|
|
|
|
|
// https://nodejs.org/api/path.html#path_path_relative_from_to
|
2018-07-15 17:25:35 +00:00
|
|
|
expect(Path.relative('/data/orandea/test/aaa', '/data/orandea/impl/bbb')).to.equal('../../impl/bbb');
|
2015-06-29 15:38:51 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('Path.resolve() should work as expectedh', function() {
|
|
|
|
// https://nodejs.org/api/path.html#path_path_resolve_from_to
|
|
|
|
expect(Path.resolve('/foo/bar', './baz')).to.equal('/foo/bar/baz');
|
|
|
|
expect(Path.resolve('/foo/bar', '/tmp/file/')).to.equal('/tmp/file');
|
|
|
|
});
|
|
|
|
});
|