Files
swagger-ui/test/unit/core/plugins/oas31/fn.js
2025-02-17 17:58:16 +01:00

17 lines
538 B
JavaScript

import { fromJS } from "immutable"
import { isOAS31 } from "core/plugins/oas31/fn"
const isOAS31Shorthand = (version) => isOAS31(fromJS({
openapi: version
}))
describe("isOAS31", function () {
it("should recognize valid OAS31 version values", function () {
expect(isOAS31Shorthand("3.1.0")).toEqual(true)
expect(isOAS31Shorthand("3.1.1")).toEqual(true)
expect(isOAS31Shorthand("3.1.12")).toEqual(true)
expect(isOAS31Shorthand("3.2.0")).toEqual(false)
expect(isOAS31Shorthand("3.0.0-rc0")).toEqual(false)
})
})