How to use the @stoplight/prism-http/router/__tests__/utils.pickSetOfHttpMethods function in @stoplight/prism-http

To help you get started, we’ve selected a few @stoplight/prism-http examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github stoplightio / prism / packages / http / src / router / __tests__ / index.spec.ts View on Github external
test('given a concrete matching server and unmatched methods should not match', async () => {
        const url = randomUrl();
        const [ resourceMethod, requestMethod ] = pickSetOfHttpMethods(2);
        const resource = await router.route({
          resources: [{
            id: chance.guid(),
            method: resourceMethod,
            path: randomPath(),
            responses: [],
            servers: [{
              url: url.toString(),
            }]
          }],
          input: {
            method: requestMethod,
            url
          }
        });