I am having trouble writing tests in javascript using sinon and tea. I'm trying to check if a function is being called by a spy, and get "Error: Invalid Chai property: calledOnce"
I am doing the same thing in another project with the same test dependencies without any problems ...
var udpSocketStub = this.sandbox.spy(udpSocket, 'send');
expect(udpSocketStub).calledOnce;
"dependencies": {
"body-parser": "~1.17.1",
"bootstrap": "^4.0.0-alpha.6",
"chai": "^4.1.0",
"co-mocha": "^1.2.0",
"cookie-parser": "~1.4.3",
"debug": "~2.6.3",
"express": "~4.15.2",
"jquery": "^3.2.1",
"mocha": "^3.4.2",
"morgan": "~1.8.1",
"node-compass": "0.2.3",
"pug": "^2.0.0-rc.1",
"serve-favicon": "~2.4.2",
"sinon": "^2.3.8",
"sinon-chai": "^2.12.0"
}
source
share