Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: make verify fn a no-op if not implemented #74

Merged
merged 1 commit into from
Jul 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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