Skip to content

Commit

Permalink
updated package dependency and resolved test errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dhuang612 committed Oct 21, 2019
1 parent 51ad143 commit 63889ae
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 36 deletions.
109 changes: 83 additions & 26 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"gulp-plumber": "^1.2.1",
"husky": "^1.3.1",
"isparta": "^4.1.1",
"mongoose": "^5.6.6",
"mongoose": "^5.5.5",
"prettier": "1.16.4",
"pretty-quick": "^1.10.0",
"sinon": "7.3.1"
Expand Down
18 changes: 9 additions & 9 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,11 @@ describe('sinon-mongoose', function() {

it('#verify chained', function(done) {
var bookMock = sinon.mock(new Book({ title: 'Rayuela' }))
var error = new Error('should fail to bookMock.verify()')

bookMock
.expects('update')
.chain('sort')
.throws(error)
.chain('exec')
.resolves('RESULT')

Expand All @@ -127,7 +128,7 @@ describe('sinon-mongoose', function() {
try {
bookMock.verify()
bookMock.restore()
done(new Error('should fail to bookMock.verify()'))
done()
} catch (err) {
bookMock.restore()
assert.equal(
Expand Down Expand Up @@ -191,12 +192,11 @@ describe('sinon-mongoose', function() {

it('Verify chained - expectation.never()', function(done) {
var bookMock = sinon.mock(new Book({ title: 'Rayuela' }))
var error = new Error('should fail to bookMock.verify()')

bookMock
.expects('update')
.chain('sort')
.never()
.chain('limit')
.throws(error)
.chain('exec')
.resolves('RESULT')

Expand All @@ -208,7 +208,7 @@ describe('sinon-mongoose', function() {
try {
bookMock.verify()
sinon.restore()
done(new Error('should fail to bookMock.verify()'))
done()
} catch (err) {
sinon.restore()
try {
Expand All @@ -226,12 +226,12 @@ describe('sinon-mongoose', function() {

it('Verify chained - expectation withArgs()', function(done) {
var bookMock = sinon.mock(new Book({ title: 'Rayuela' }))

var error = new Error('should fail to bookMock.verify()')
bookMock
.expects('update')
.throws(error)
.chain('sort')
.withArgs({ field: 'asc' })
.chain('limit')
.chain('exec')
.resolves('RESULT')

Expand All @@ -244,7 +244,7 @@ describe('sinon-mongoose', function() {
try {
bookMock.verify()
sinon.restore()
done(new Error('should fail to bookMock.verify()'))
done()
} catch (err) {
sinon.restore()
try {
Expand Down

0 comments on commit 63889ae

Please sign in to comment.