Files
weave-scope/client/app/scripts/utils/__tests__/web-api-utils-test.js

26 lines
606 B
JavaScript

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