Spy Meteor Testing

I use Velocity with a mike: mocha map and chai statements. Everything works fine, but when the time comes to do the feet, mockery and spying, I hit the roadblock. These are not the main features of mike: mocha or chai, so I found a practical meteorist: chai who should / could add spies.

My first blow to figuring out if this is true is to write the following code:

  it 'calls update when both documents are present but different', ->
    spies.create('log', console, 'log')

which gives me:

ReferenceError: spies is not defined
    at packages/velocity:test-proxy/tests/mocha/server/charger_server_doc_spec.coffee:88:9
    at wrappedFunc (packages/mike:mocha/server.js:200:1)
    at runWithEnvironment (packages/mike:mocha/server.js:156:1)

This means that I misunderstood that a practical meteorite: chai provides, however, the code that I showed in the first example is copied verbatim from README.

Question: Any tips on working with this? Is this a download problem? The code on Github shows spies, etc., implemented in this package. So I'm a little stuck.

Thank!

+4
1

practicalmeteor:chai practicalmeteor:sinon, API spies.

, chai.

package.js practicalmeteor:chai, sinon.

, meteor add practicalmeteor:sinon .

+5

Source: https://habr.com/ru/post/1569752/


All Articles