Skip to content

Commit

Permalink
feat: make verify fn a no-op if not implemented (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
pritamstyz4ever authored Jul 12, 2021
1 parent b53d955 commit 048c427
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class Executor {
}

async _verify() {
throw new Error('Not implemented');
// no-op in case not implemented in extenders
}

/**
Expand Down
11 changes: 5 additions & 6 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,13 @@ describe('index test', () => {
}
));

it('verify returns an error when not overridden', () =>
it('verify does not return an error when not overridden', () =>
instance.verify({}).then(
() => {
throw new Error('Oh no');
message => {
assert.equal(message, undefined);
},
err => {
assert.isOk(err, 'err is null');
assert.equal(err.message, 'Not implemented');
() => {
throw new Error('should not fail');
}
));

Expand Down

0 comments on commit 048c427

Please sign in to comment.