parse-openapi
Version:
OpenAPI v3 parser
27 lines (26 loc) • 1.69 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const uvu_1 = require("uvu");
const strict_1 = __importDefault(require("assert/strict"));
const getMappedType_1 = require("./getMappedType");
(0, uvu_1.test)('getMappedType should map types to the basics', () => {
strict_1.default.equal((0, getMappedType_1.getMappedType)('file'), 'binary');
strict_1.default.equal((0, getMappedType_1.getMappedType)('string'), 'string');
strict_1.default.equal((0, getMappedType_1.getMappedType)('date'), 'string');
strict_1.default.equal((0, getMappedType_1.getMappedType)('date-time'), 'string');
strict_1.default.equal((0, getMappedType_1.getMappedType)('float'), 'number');
strict_1.default.equal((0, getMappedType_1.getMappedType)('double'), 'number');
strict_1.default.equal((0, getMappedType_1.getMappedType)('short'), 'number');
strict_1.default.equal((0, getMappedType_1.getMappedType)('int'), 'number');
strict_1.default.equal((0, getMappedType_1.getMappedType)('boolean'), 'boolean');
strict_1.default.equal((0, getMappedType_1.getMappedType)('any'), 'any');
strict_1.default.equal((0, getMappedType_1.getMappedType)('object'), 'any');
strict_1.default.equal((0, getMappedType_1.getMappedType)('void'), 'void');
strict_1.default.equal((0, getMappedType_1.getMappedType)('null'), 'null');
strict_1.default.equal((0, getMappedType_1.getMappedType)('unknown'), undefined);
strict_1.default.equal((0, getMappedType_1.getMappedType)(''), undefined);
});
uvu_1.test.run();