You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a suite of tests using chai spies. Basically, every test case attaches a new spy and records the number of times that spy gets called, and with which arguments.
All is fine, until I switch from 0.7.1 to the master branch where I get the following error:
Error: "foo" is already a spy
Here is a simple script that replicates the issue:
constchai=require('chai');constspies=require('chai-spies');const{ EventEmitter }=require('events');chai.use(spies);constemitter=newEventEmitter();functionfoo(){constspy=chai.spy.on(emitter,'emit');};functionbar(){constspy=chai.spy.on(emitter,'emit');}foo();// OKbar();// Error: "emit" is already a spy
The above script works fine on version 0.7.1, but throws the error on the master branch. This looks to me like a regression.
I have used Node EventEmitter here, but you can reproduce with any other function.
Regards
The text was updated successfully, but these errors were encountered:
I have a suite of tests using chai spies. Basically, every test case attaches a new spy and records the number of times that spy gets called, and with which arguments.
All is fine, until I switch from
0.7.1
to themaster
branch where I get the following error:Error: "foo" is already a spy
Here is a simple script that replicates the issue:
The above script works fine on version
0.7.1
, but throws the error on themaster
branch. This looks to me like a regression.I have used Node EventEmitter here, but you can reproduce with any other function.
Regards
The text was updated successfully, but these errors were encountered: