openapi-client-sdk-loader
Version:
An Open API loader for webpack. Compiles yaml to client sdk.
27 lines (25 loc) • 1 kB
JavaScript
;
var _string = require("./string");
describe('utils', () => {
describe('string:capitalize', () => {
it('should capitalize the given string', async () => {
expect((0, _string.capitalize)('some string')).toBe('Some string');
});
});
describe('string:basepath', () => {
it('should return the basepath of the given string', async () => {
expect((0, _string.basepath)('/test/some/case')).toBe('case');
});
it('should return the given string if there are no / in it', async () => {
expect((0, _string.basepath)('case')).toBe('case');
});
});
describe('string:dashes2capitals', () => {
it('should return the capitalized version of the given dashed string', async () => {
expect((0, _string.dashes2capitals)('-test-some--case')).toBe('TestSomeCase');
});
it('should return the given string capitalized if there are no - in it', async () => {
expect((0, _string.dashes2capitals)('case')).toBe('Case');
});
});
});