Commit d134419d authored by Sebastiaan Deckers's avatar Sebastiaan Deckers 馃悜

refactor: use new configuration validate() API

parent 617d6e5a
Pipeline #41991256 passed with stage
in 3 minutes and 55 seconds
......@@ -4,7 +4,7 @@ const { directoryExists } = require('../helpers/directoryExists')
const defaultsDeep = require('lodash.defaultsdeep')
const { defaultOptions } = require('./default/options')
const {
ConfigurationValidator,
validate,
normaliseHost,
loadFile,
findFile
......@@ -140,7 +140,7 @@ async function load ({
}
}
new ConfigurationValidator().validate(result)
validate(result)
return result
}
......
......@@ -26,7 +26,7 @@ test('Start with a valid external manifest', async (t) => {
test('Start with a non-existent external manifest', async (t) => {
const args = ['start', '--options', 'external-manifest/missing-manifest.json']
const message = 'Error: Invalid Configuration'
const message = 'Error: Cannot find module'
const node = await startServer({ args, message, throwOnCrash: false })
await eventToPromise(node, 'exit')
})
......
......@@ -25,7 +25,7 @@ test('Test a valid external manifest', async (t) => {
test('Test a non-existent external manifest', async (t) => {
const args = ['test', '--options', 'external-manifest/missing-manifest.json']
const message = 'FAIL: Invalid Configuration'
const message = 'FAIL: Cannot find module'
const node = await startServer({ args, message, throwOnCrash: false })
await eventToPromise(node, 'exit')
})
[
{
"manifest": "does-not-exist"
}
]
{
"hosts": [
{
"manifest": "does-not-exist"
}
]
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment