Files
weave-scope/client/app/scripts/utils/__tests__/web-api-utils-test.js
2015-12-15 16:14:39 +01:00

26 lines
636 B
JavaScript

jest.dontMock('../web-api-utils');
describe('WebApiUtils', function() {
const WebApiUtils = require('../web-api-utils');
describe('basePath', function() {
const basePath = WebApiUtils.basePath;
it('should handle /scope/terminal.html', function() {
expect(basePath('/scope/terminal.html')).toBe('/scope');
});
it('should handle /scope/', function() {
expect(basePath('/scope/')).toBe('/scope');
});
it('should handle /scope', function() {
expect(basePath('/scope')).toBe('/scope');
});
it('should handle /', function() {
expect(basePath('/')).toBe('');
});
});
});