1

我的包裹有一个foo.htmlfoo.coffee一个Template.foo.helpers ...

当我运行 mocha 包测试时:

meteor test-packages --driver-package velocity:console-reporter mypkg

我得到:

W20151209-04:58:22.249(-5)? (STDERR) /Users/me/.meteor/packages/meteor-tool/.1.1.10.1gqrep8++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:245
W20151209-04:58:22.249(-5)? (STDERR)                        throw(ex);
W20151209-04:58:22.249(-5)? (STDERR)                              ^
W20151209-04:58:22.250(-5)? (STDERR) TypeError: Cannot call method 'helpers' of undefined
=> Exited with code: 8

package.js有:

Package.onUse(function(api) {
  api.use('meteor-platform');
  ...
  api.addFiles(['foo.html', 'foo.coffee'],'client');
  api.addFiles(['bar.coffee'],'server');
})

Package.onTest(function(api) {
  api.use('mike:mocha-package');
  api.use('meteor-platform');
  ...
  api.addFiles(['tests.coffee'],'server');
})

我也试过.useing

  api.use('meteor-base');
  api.use('blaze-html-templates');

而不是meteor-platform.

4

0 回答 0