UNPKG

openapi-modifier

Version:

This package allows you to automate the process of modifying OpenAPI specifications by applying a set of predefined rules

20 lines (19 loc) 946 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const parse_endpoint_descriptor_1 = require("./parse-endpoint-descriptor"); describe('parseSimpleEndpointDescriptor', () => { test.each([ ['get /foo/bar', { path: '/foo/bar', method: 'get' }], ['GET /foo/bar', { path: '/foo/bar', method: 'GET' }], ['GET foo/bar', { path: 'foo/bar', method: 'GET' }], [' GET /foo/bar ', { path: '/foo/bar', method: 'GET' }], [' [GET] /foo/bar ', { path: '/foo/bar', method: 'GET' }], [' GET -> /foo/bar ', { path: '/foo/bar', method: 'GET' }], [' [GET] -> /foo/bar ', { path: '/foo/bar', method: 'GET' }], ['GET/foo/bar', null], ['', null], [' ', null], ])('parseSimpleEndpointDescriptor(%s)', (schema, expectedResult) => { expect((0, parse_endpoint_descriptor_1.parseSimpleEndpointDescriptor)(schema)).toEqual(expectedResult); }); });