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

Not compatible with Sinon 8.x #58

Open
YasharF opened this issue Jan 2, 2020 · 14 comments
Open

Not compatible with Sinon 8.x #58

YasharF opened this issue Jan 2, 2020 · 14 comments

Comments

@YasharF
Copy link
Contributor

YasharF commented Jan 2, 2020

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
Copy link
Contributor Author

YasharF commented Jan 2, 2020

@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!

@gaguirre
Copy link
Collaborator

gaguirre commented Jan 3, 2020

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

@YasharF
Copy link
Contributor Author

YasharF commented Jan 3, 2020

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

@YasharF
Copy link
Contributor Author

YasharF commented Jan 6, 2020

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.

@gaguirre
Copy link
Collaborator

gaguirre commented Jan 6, 2020

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.

@YasharF
Copy link
Contributor Author

YasharF commented Jan 6, 2020

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.

@gaguirre
Copy link
Collaborator

gaguirre commented Jan 6, 2020

@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 😞

@dhuang612
Copy link

sure I can take over the ownership of this repo

@gaguirre
Copy link
Collaborator

gaguirre commented Jan 7, 2020

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.

@dhuang612
Copy link

sure thing no problem

@dhuang612
Copy link

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

Thanks

mir4ef added a commit to mir4ef/sinon-mongoose that referenced this issue Feb 13, 2020
…moved `sinon.sandbox.create` and bumped the peer dependency to `5 - 8`
@suda
Copy link

suda commented May 14, 2020

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?

@kdhttps
Copy link

kdhttps commented Jun 30, 2020

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.

@simonnilsson
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants