ksmithut/skyway

View on GitHub
swagger2/routes/normalize-docs/__tests__/normalize-docs.test.js

Summary

Maintainability
A
0 mins
Test Coverage
/* eslint-env jest */
'use strict'

const path = require('path')
const SwaggerParser = require('swagger-parser')
const normalizeDocs = require('../')

const fixtures = path.resolve.bind(path, __dirname, 'fixtures')

describe('swagger2/normalizeDocs', () => {
  test('produces expected object', () => {
    return SwaggerParser.validate(fixtures('swagger.yaml')).then(docs => {
      expect(normalizeDocs(docs)).toMatchSnapshot()
    })
  })
})