nordcloud/serverless-mocha-plugin

Plugin seems not triggered with serverless 1.33.0 (and higer)

Thana404 opened this issue · 5 comments

Hi,

Since my update to sls 1.33.x few days ago, serverless-mocha-plugin doesn't work anymore.
While executing "sls invoke test", nothing happens. Literally nothing. If "--verbose" and "SLS_DEBUG=*" are used, the only output I get is:

...
Serverless: Load command invoke
Serverless: Load command invoke:test
Serverless: Invoke invoke:test

And that's it.
I tested with both 1.9.0 and 1.8.2 npm version of the plugin, and I'm using node version 11.2.0.

I tried using mocha through npm and all my tests are properly executed.

Guessing it had something to do with sls update, I downgraded it to 1.32.0 and the plugin worked again, properly.

I'll gladly provide any more information if needed, feel free to ask !

Thanks !

Same behaviour here, I had to downgrade to 1.32.0

Trying to figure out what's broken this. Based on serverless 1.33 release notes, no major changes to plugin mechanism.

still an issue in serverless 1.34, downgraded to serverless 1.32 to fix.

This should now be fixed in 1.9.1

Hi,

Thanks for the fix, sls invoke test is now working.
Unfortunately, there seems to be a regression with "sinon". Now I got this kind of error:

TypeError: Attempted to wrap fail which is already wrapped
      at checkWrappedMethod (node_modules/sinon/lib/sinon/util/core/wrap-method.js:39:21)
      at wrapMethod (node_modules/sinon/lib/sinon/util/core/wrap-method.js:87:13)
      at Function.spy (node_modules/sinon/lib/sinon/spy.js:46:16)
      at Sandbox.spy (node_modules/sinon/lib/sinon/sandbox.js:275:26)
      ...

I've tested with SLS 1.34.0 and 1.35.0 + Sinon 7.1.1 and above + serverless-mocha-plugin 1.9.1.
For the record, everything was working fine with SLS 1.32.0 + Sinon 7.1.1 + serverless-mocha-plugin 1.9.0.
I'm note quite sure what could cause this issue, but let me know if more tests or details are needed.

Thanks !