openapi-client-sdk-loader
Version:
An Open API loader for webpack. Compiles yaml to client sdk.
24 lines (20 loc) • 848 B
JavaScript
;
var _compile = _interopRequireDefault(require("../compile"));
var _normalize = _interopRequireDefault(require("./normalize"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
describe('options', () => {
describe('normalize', () => {
it('should replace string compiler option with the according compiler function', async () => {
const normalizedOptions = (0, _normalize.default)({
compiler: 'ts'
});
expect(normalizedOptions.compiler).toBe(_compile.default.ts);
});
it('should remove string compiler option if the according compiler function does not exist', async () => {
const normalizedOptions = (0, _normalize.default)({
compiler: 'abracadabra'
});
expect(normalizedOptions.compiler).toBe(null);
});
});
});