sinon-mongoose icon indicating copy to clipboard operation
sinon-mongoose copied to clipboard

Not compatible with Sinon 8.x

Open YasharF opened this issue 5 years ago • 14 comments

Changelog for Sinon: https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md

The following is the error that appears when running the built-in tests after bumping Sinon in the dev dependency list to v8.0.2:

:/mnt/c/temp/sinon-mongoose$ npm test

> [email protected] test /mnt/c/temp/sinon-mongoose
> gulp

[13:46:14] Using gulpfile /mnt/c/temp/sinon-mongoose/gulpfile.js
[13:46:14] Starting 'default'...
[13:46:14] Starting 'static'...
[13:46:25] Finished 'static' after 10 s
[13:46:25] Starting 'test'...
[13:46:25] Starting 'pre-test'...
[13:46:25] Finished 'pre-test' after 112 ms
[13:46:25] Starting 'testTask'...
/mnt/c/temp/sinon-mongoose/lib/index.js:98
sinon.sandbox.mock = sandboxMock
                   ^

TypeError: Cannot set property 'mock' of undefined
    at Object.<anonymous> (/mnt/c/temp/sinon-mongoose/lib/index.js:98:20)
    at Module._compile (internal/modules/cjs/loader.js:959:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
    at Module.require (internal/modules/cjs/loader.js:852:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/mnt/c/temp/sinon-mongoose/test/index.js:6:1)
    at Module._compile (internal/modules/cjs/loader.js:959:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
    at Module.require (internal/modules/cjs/loader.js:852:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at /mnt/c/temp/sinon-mongoose/node_modules/mocha/lib/mocha.js:250:27
    at Array.forEach (<anonymous>)
    at Mocha.loadFiles (/mnt/c/temp/sinon-mongoose/node_modules/mocha/lib/mocha.js:247:14)
    at Mocha.run (/mnt/c/temp/sinon-mongoose/node_modules/mocha/lib/mocha.js:576:10)
    at Object.<anonymous> (/mnt/c/temp/sinon-mongoose/node_modules/mocha/bin/_mocha:637:18)
    at Module._compile (internal/modules/cjs/loader.js:959:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)
    at internal/main/run_main_module.js:17:11
-----------|----------|----------|----------|----------|----------------|
File       |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
-----------|----------|----------|----------|----------|----------------|
 lib/      |    11.54 |        0 |        0 |    11.54 |                |
  index.js |    11.54 |        0 |        0 |    11.54 |... 91,92,95,98 |
-----------|----------|----------|----------|----------|----------------|
All files  |    11.54 |        0 |        0 |    11.54 |                |
-----------|----------|----------|----------|----------|----------------|


=============================== Coverage summary ===============================
Statements   : 11.54% ( 6/52 )
Branches     : 0% ( 0/19 )
Functions    : 0% ( 0/9 )
Lines        : 11.54% ( 6/52 )
================================================================================
[13:46:27] 'testTask' errored after 1.93 s
[13:46:27] Error in plugin "gulp-mocha"
Message:
    There were test failures
[13:46:27] 'test' errored after 2.05 s
[13:46:27] 'default' errored after 12 s
npm ERR! Test failed.  See above for more details.

YasharF avatar Jan 02 '20 21:01 YasharF

@andyesp, @aschenkel I noticed https://github.com/orgs/underscopeio/people isn't listing @gaguirre as part of the org. I thought he was maintaining this package. This package, sinon-mongoose seems to need some love. It currently doesn't work with the latest version of Sinon or Mongoose. Is this something that underscopeio would like to continue own and maintain, or would you rather have the package moved to a different org?

Thank you!

YasharF avatar Jan 02 '20 22:01 YasharF

Hi @YasharF, you already had permissions to merge PRs. Let me know if that's not the case 😃

gaguirre avatar Jan 03 '20 13:01 gaguirre

I think I only have partial permissions. The following is what is always showing up: image

YasharF avatar Jan 03 '20 17:01 YasharF

I managed to remove the dependency on sinon-mongoose in my projects this morning; you can probably remove my permissions to merge in this repo if there is one. Thank you.

YasharF avatar Jan 06 '20 20:01 YasharF

Sorry for the trouble @YasharF, I just saw your comment. I thought you were able to merge. I can transfer the repo ownership to you, would you accept it? You're actively using it so I think it will be the best.

gaguirre avatar Jan 06 '20 20:01 gaguirre

I am no longer actively using sinon-mongoose as of about an hour ago. I don't think if it would be a good idea to transfer it to me. Perhaps @dhuang612 might be able to help.

YasharF avatar Jan 06 '20 21:01 YasharF

@dhuang612 would you like that?

Again, sorry for the trouble @YasharF, it was never my idea. I thought you're already able to merge PRs 😞

gaguirre avatar Jan 06 '20 21:01 gaguirre

sure I can take over the ownership of this repo

dhuang612 avatar Jan 06 '20 21:01 dhuang612

I can't transfer the repo from an organization to a user 🤷‍♂ Give me some time to figure out what it takes to make you owner, since it also involves npm ownership.

gaguirre avatar Jan 07 '20 14:01 gaguirre

sure thing no problem

dhuang612 avatar Jan 07 '20 14:01 dhuang612

@gaguirre hey reaching out to see if there are any updates?

Thanks

dhuang612 avatar Jan 24 '20 04:01 dhuang612

Looks like Miro did the fix in #62. @gaguirre is it possible to add @dhuang612 as a maintainer so he could review/merge/release it?

suda avatar May 14 '20 15:05 suda

Thanks to Miro. But as it is not updated on npm so I did the manual setup.

description is here https://stackoverflow.com/questions/62653523/sinon-mongoose-is-not-working-with-sinon-9/62654152#62654152

I hope it will help someone.

kdhttps avatar Jun 30 '20 09:06 kdhttps

Would be great if this could be fixed so one can update sinon.

simonnilsson avatar Sep 03 '20 10:09 simonnilsson