Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dawnerd committed May 9, 2019
1 parent 5121b1a commit 42c1edc
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 43 deletions.
12 changes: 12 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Tap current file",
"program": "${workspaceFolder}/${relativeFile}",
"cwd": "${workspaceFolder}"
}
]
}
56 changes: 16 additions & 40 deletions test/expectedOutput.js
Original file line number Diff line number Diff line change
@@ -1,61 +1,37 @@
module.exports = {
envVars: {
envVars:
{
gitCommit: '',
gitBranch: '',
port: 8080,
routePrefix: '',
healthToken: false,
enableProm: false,
forceHttps: false,
logRequests: false,
logRequests: false
},
name: 'rapptor',
verbose: false,
server: {
debug: false,
port: 8080,
address: '0.0.0.0'
},
server: { debug: false, port: 8080, address: '0.0.0.0' },
routePrefix: '',
plugins: {
'hapi-health': {
token: false,
endpoint: '/health',
auth: false
},
'hapi-logr': {
plugins:
{
'hapi-health': { token: false, endpoint: '/health', auth: false },
'hapi-logr':
{
unhandledRejection: true,
uncaughtException: true,
reporters: {
sentry: {
reporter: 'logr-sentry',
options: {
environment: 'dev',
logger: 'rapptor',
filter: ['error', 'warning', 'user-error', 'server-error', 'sentry']
}
}
}
},
'hapi-require-https': {
_enabled: false
},
'hapi-method-loader': {
verbose: false,
autoLoad: true
},
'hapi-route-loader': {
prefix: '',
verbose: false
reporters: [Object]
},
'hapi-log-response': {
'hapi-require-https': { _enabled: false },
'hapi-method-loader': { verbose: false, autoLoad: true },
'hapi-route-loader': { prefix: '', verbose: false },
'hapi-log-response':
{
requests: false,
includeEventTags: true,
ignoreUnauthorizedTry: true
},
'hapi-trailing-slash': {
method: 'remove',
statusCode: 301
}
'hapi-trailing-slash': { method: 'remove', statusCode: 301 }
}
};
6 changes: 3 additions & 3 deletions test/initialize.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ tap.test('initializes a new instance of rapptor', async t => {
const { server, config } = await rapptor.start();
t.equal(typeof server, 'object');
t.equal(typeof config, 'object');
t.match(config, expected, 'loads config');
t.match(JSON.toString(config), JSON.toString(expected), 'loads config');
await rapptor.stop();
t.end();
});
Expand Down Expand Up @@ -45,7 +45,7 @@ tap.test('be able to load a config with setup', async t => {
const { server, config } = await rapptor.setup();
t.equal(typeof server, 'object');
t.equal(typeof config, 'object');
t.match(config, expected, 'loads config');
t.match(JSON.toString(config), JSON.toString(expected), 'loads config');
await rapptor.stop();
t.end();
});
Expand All @@ -61,7 +61,7 @@ tap.test('be able to load a config from directory', async t => {
const { server, config } = await rapptor.setup();
t.equal(typeof server, 'object');
t.equal(typeof config, 'object');
t.match(config, expected, 'loads config');
t.match(JSON.toString(config), JSON.toString(expected), 'loads config');
t.equal(config.someValue, 'also', 'loads additional config');
await rapptor.stop();
t.end();
Expand Down

0 comments on commit 42c1edc

Please sign in to comment.