mirror of
https://github.com/Permissionless-Software-Foundation/bch-dex.git
synced 2026-09-21 16:52:00 -07:00
fix(tests): Increased coverage of REST API validators
This commit is contained in:
Vendored
+6
-1
@@ -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
@@ -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
@@ -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 }
|
||||
|
||||
Reference in New Issue
Block a user