1.0.2 • Published 6 years ago
kth-node-test-swagger-auth v1.0.2
kth-node-test-swagger-auth
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)