Skip to content
This repository has been archived by the owner on Nov 3, 2022. It is now read-only.

Commit

Permalink
update test script
Browse files Browse the repository at this point in the history
  • Loading branch information
genediazjr committed Feb 11, 2018
1 parent 3dd6cfe commit 0fdb83a
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,19 @@ describe('registration and functionality', () => {

it('returns error if no option', async () => {

let err;

try {

await register({});
}
catch (err) {
catch (ex) {

expect(err).to.exist();
expect(err.message).to.equal('Missing prefix');
err = ex;
}

expect(err).to.exist();
expect(err.message).to.equal('Missing prefix');
});

it('adds new server.app value', async () => {
Expand Down Expand Up @@ -94,6 +98,8 @@ describe('registration and functionality', () => {

it('returns error on unparsable value', async () => {

let err;

Plugin.__set__('process', {
env: {
FOO_VAR_test1: '{"path":"some.config.stuff","value":"Bazinga!"}',
Expand All @@ -105,11 +111,13 @@ describe('registration and functionality', () => {

await register({ prefix: 'FOO_VAR_' });
}
catch (err) {
catch (ex) {

expect(err).to.exist();
expect(err.message).to.equal('Value unparsable: not a stringified object');
err = ex;
}

expect(err).to.exist();
expect(err.message).to.equal('Value unparsable: not a stringified object');
});

it('ignores if no value key', async () => {
Expand Down

0 comments on commit 0fdb83a

Please sign in to comment.