hwillson / meteor-stub-collections

Stub out Meteor collections with in-memory local collections.
MIT License
24 stars 17 forks source link

TypeError: _meteorHwillsonStubCollections2.default.add is not a function #19

Open aymericbouzy opened 6 years ago

aymericbouzy commented 6 years ago

I get the following error :

1) schema "before each" hook for "should pass":
I20170831-16:25:22.476(2)?      TypeError: _meteorHwillsonStubCollections2.default.add is not a function
I20170831-16:25:22.477(2)?       at Hook.<anonymous> (server/apollo/stub.test.js:5:21)
I20170831-16:25:22.479(2)?       at run (packages/practicalmeteor:mocha-core/server.js:34:29)
I20170831-16:25:22.486(2)? 
I20170831-16:25:22.486(2)?   2) schema "after each" hook for "should pass":
I20170831-16:25:22.487(2)?      TypeError: _meteorHwillsonStubCollections2.default.restore is not a function
I20170831-16:25:22.499(2)?       at Hook.<anonymous> (server/apollo/stub.test.js:10:21)
I20170831-16:25:22.500(2)?       at run (packages/practicalmeteor:mocha-core/server.js:34:29)

My file :

import StubCollections from "meteor/hwillson:stub-collections"

describe("schema", () => {
  beforeEach(() => {
    StubCollections.add([Contracts])
    StubCollections.stub()
  })

  afterEach(() => {
    StubCollections.restore()
  })

  it("should pass", () => {})
})

Can anyone tell me what I'm doing wrong?

hwillson commented 6 years ago

Any chance you could put together a small, runnable reproduction showing this issue? If so I'll take a look. Thanks!