2019-01-19 20:00:38 +08:00
|
|
|
import {expect} from 'chai';
|
2019-12-10 17:44:35 +08:00
|
|
|
import {Utils} from '../../../src/common/Utils';
|
2019-01-19 20:00:38 +08:00
|
|
|
|
|
|
|
describe('Utils', () => {
|
|
|
|
it('should concat urls', () => {
|
|
|
|
expect(Utils.concatUrls('abc', 'cde')).to.be.equal('abc/cde');
|
|
|
|
expect(Utils.concatUrls('abc/', 'cde')).to.be.equal('abc/cde');
|
|
|
|
expect(Utils.concatUrls('abc\\', 'cde')).to.be.equal('abc/cde');
|
|
|
|
expect(Utils.concatUrls('abc/', 'cde/')).to.be.equal('abc/cde');
|
|
|
|
expect(Utils.concatUrls('./abc\\', 'cde/')).to.be.equal('./abc/cde');
|
|
|
|
expect(Utils.concatUrls('abc/', '\\cde/')).to.be.equal('abc/cde');
|
|
|
|
expect(Utils.concatUrls('abc\\', '\\cde/')).to.be.equal('abc/cde');
|
|
|
|
expect(Utils.concatUrls('abc\\', '/cde/')).to.be.equal('abc/cde');
|
|
|
|
expect(Utils.concatUrls('abc/', '/cde/')).to.be.equal('abc/cde');
|
|
|
|
expect(Utils.concatUrls('abc\\/', '/cde/')).to.be.equal('abc/cde');
|
|
|
|
expect(Utils.concatUrls('abc\\/', '/cde/', 'fgh')).to.be.equal('abc/cde/fgh');
|
|
|
|
});
|
|
|
|
});
|