fix(tests): Increased coverage of REST API validators

This commit is contained in:
Chris Troutner
2022-09-17 14:18:16 -07:00
parent d266bcc54b
commit d9377ea78b
15 changed files with 534 additions and 259 deletions
+6 -1
View File
@@ -5,9 +5,14 @@
/* eslint no-unneeded-ternary:0 */
// Hack to get __dirname back.
// https://blog.logrocket.com/alternatives-dirname-node-js-es-modules/
import * as url from 'url'
// Get the version from the package.json file.
import { readFileSync } from 'fs'
const pkgInfo = JSON.parse(readFileSync('package.json'))
const __dirname = url.fileURLToPath(new URL('.', import.meta.url))
const pkgInfo = JSON.parse(readFileSync(`${__dirname.toString()}/../../package.json`))
const version = pkgInfo.version
+2 -1
View File
@@ -5,11 +5,12 @@ import production from './env/production.js'
import test from './env/test.js'
const env = process.env.SVC_ENV || 'development'
console.log(`Loading config for this environment: ${env}`)
let config = development
if (env === 'test') {
config = test
} else if (env === 'production') {
} else if (env === 'prod') {
config = production
}
+4 -1
View File
@@ -49,8 +49,11 @@ function applyPassportMods (passport) {
passportCallback
)
)
return true
}
// For testing
// export default { passport, passportCallback };
export default applyPassportMods
// export default applyPassportMods
export { applyPassportMods, passportCallback }