1.0.2 • Published 6 years ago

kth-node-test-swagger-auth v1.0.2

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago

kth-node-test-swagger-auth

Build Status

This package is intended to be imported in api projects to easily setup a mocha/chai test checking that the server has implemented security on its routes as specified in its swagger.json file.

Example: /path/to/api-project/test/integration/swaggerAuthTest.js

This example it intended to be used locally on dev machine.

'use strict'

require('dotenv').config()
const secureConfig = require('../../server/configuration').server
const swagger = require('../../swagger.json')
const basePath = 'http://localhost:' + secureConfig.port
const swaggerTest = require('kth-node-test-swagger-auth')

swaggerTest.createTest(basePath, secureConfig.proxyPrefixPath.uri, swagger)