Skip to content

Commit

Permalink
fix: reject with error object instead of string
Browse files Browse the repository at this point in the history
  • Loading branch information
minzcmu committed Sep 27, 2017
1 parent 9de6bac commit 2fca221
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class Executor {
}

_start() {
return Promise.reject('Not implemented');
return Promise.reject(new Error('Not implemented'));
}

/**
Expand All @@ -66,7 +66,7 @@ class Executor {
}

_stop() {
return Promise.reject('Not implemented');
return Promise.reject(new Error('Not implemented'));
}

/**
Expand All @@ -82,7 +82,7 @@ class Executor {
}

_status() {
return Promise.reject('Not implemented');
return Promise.reject(new Error('Not implemented'));
}

/**
Expand Down
6 changes: 3 additions & 3 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('index test', () => {
throw new Error('Oh no');
}, (err) => {
assert.isOk(err, 'err is null');
assert.equal(err, 'Not implemented');
assert.equal(err.message, 'Not implemented');
})
));

Expand All @@ -78,7 +78,7 @@ describe('index test', () => {
throw new Error('Oh no');
}, (err) => {
assert.isOk(err, 'error is null');
assert.equal(err, 'Not implemented');
assert.equal(err.message, 'Not implemented');
})
));

Expand All @@ -98,7 +98,7 @@ describe('index test', () => {
throw new Error('Oh no');
}, (err) => {
assert.isOk(err, 'error is null');
assert.equal(err, 'Not implemented');
assert.equal(err.message, 'Not implemented');
})
));

Expand Down

0 comments on commit 2fca221

Please sign in to comment.