After update to Meteor 1.6.1, when I want to test using:
meteor test --full-app --driver-package practicalmeteor:mocha
Error occur and show only blank page, not the usual html reporter page.
> meteor reset && meteor test --full-app --driver-package practicalmeteor:mocha --port 3220 --settings __tests__/settings.json
Project reset.
[[[[[ Tests ]]]]]
=> Started proxy.
=> Started MongoDB.
=> Started your app.
=> App running at: http://localhost:3220/
W20180131-18:13:07.799(7)? (STDERR) "[object Object]" reporter blew up with error:
W20180131-18:13:07.858(7)? (STDERR) AssertionError [ERR_ASSERTION]: path must be a string
W20180131-18:13:07.858(7)? (STDERR) at Module.require (module.js:586:3)
W20180131-18:13:07.859(7)? (STDERR) at require (internal/module.js:11:18)
W20180131-18:13:07.859(7)? (STDERR) at Mocha.reporter (/home/andreas/.meteor/packages/practicalmeteor_mocha-core/.1.0.1.117ym50++os+web.browser+web.cordova/npm/node_modules/mocha/lib/mocha.js:167:21)
W20180131-18:13:07.859(7)? (STDERR) at MochaRunner.coffee.js.MochaRunner.runServerTests (packages/practicalmeteor_mocha/meteor/src/lib/MochaRunner.coffee:72:19)
W20180131-18:13:07.859(7)? (STDERR) at MochaRunner.runServerTests (packages/practicalmeteor_mocha/meteor/src/lib/MochaRunner.coffee:1:1)
W20180131-18:13:07.860(7)? (STDERR) at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1768:12)
W20180131-18:13:07.860(7)? (STDERR) at DDP._CurrentMethodInvocation.withValue (packages/ddp-server/livedata_server.js:719:19)
W20180131-18:13:07.860(7)? (STDERR) at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1186:15)
W20180131-18:13:07.860(7)? (STDERR) at DDPServer._CurrentWriteFence.withValue (packages/ddp-server/livedata_server.js:717:46)
W20180131-18:13:07.860(7)? (STDERR) at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1186:15)
W20180131-18:13:07.861(7)? (STDERR) at Promise (packages/ddp-server/livedata_server.js:715:46)
W20180131-18:13:07.861(7)? (STDERR) at new Promise (<anonymous>)
W20180131-18:13:07.869(7)? (STDERR) at Session.method (packages/ddp-server/livedata_server.js:689:23)
W20180131-18:13:07.870(7)? (STDERR) at packages/ddp-server/livedata_server.js:559:43
I20180131-18:13:07.870(7)? Exception while invoking method 'mocha/runServerTests' Error: invalid reporter "[object Object]"
I20180131-18:13:07.871(7)? at Mocha.reporter (/home/andreas/.meteor/packages/practicalmeteor_mocha-core/.1.0.1.117ym50++os+web.browser+web.cordova/npm/node_modules/mocha/lib/mocha.js:180:13)
I20180131-18:13:07.871(7)? at MochaRunner.coffee.js.MochaRunner.runServerTests (packages/practicalmeteor_mocha/meteor/src/lib/MochaRunner.coffee:72:19)
I20180131-18:13:07.871(7)? at MochaRunner.runServerTests (packages/practicalmeteor_mocha/meteor/src/lib/MochaRunner.coffee:1:1)
I20180131-18:13:07.872(7)? at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1768:12)
I20180131-18:13:07.872(7)? at DDP._CurrentMethodInvocation.withValue (packages/ddp-server/livedata_server.js:719:19)
I20180131-18:13:07.872(7)? at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1186:15)
I20180131-18:13:07.873(7)? at DDPServer._CurrentWriteFence.withValue (packages/ddp-server/livedata_server.js:717:46)
I20180131-18:13:07.873(7)? at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1186:15)
I20180131-18:13:07.873(7)? at Promise (packages/ddp-server/livedata_server.js:715:46)
I20180131-18:13:07.873(7)? at new Promise (<anonymous>)
I20180131-18:13:07.873(7)? at Session.method (packages/ddp-server/livedata_server.js:689:23)
I20180131-18:13:07.874(7)? at packages/ddp-server/livedata_server.js:559:43
… One notable example is the practicalmeteor:mocha package. If you have been using this test-driver package, we strongly recommend switching to meteortesting:mocha instead…
Yes, the error is different, because I use meteortesting:mocha as driver package now.
Do I need to create another topic?
My main purpose here is ability to test.
I can not upgrade to 1.6.1 unless I am able to run the test (I am thinking about rollback now).
I try to create server only app.
But the document there was called inside mocha library.
When I was using practicalmeteor:mocha, the default report shows in a web page.
practicalmeteor:mocha points to coffeescript 1 which is not supported when running on Meteor 1.6.1 anymore. Which has also been mentioned in the blog article.
However, switching to meteortesting:mocha is not trivial, since it’s reporters behave differently and you have to change your setup.
But it seems that this repo is not really maintained anymore
I am waiting a little bit more in the hope that they will make a compatibility build or something and if not, switch also to meteortesting:mocha but currently there is no time for me to hack around for two days just in order to get my tests running just because of a version update.
Just to clarify that practicalmeteor:mocha-core does not depend on coffeescript - it’s just plain JavaScript which wraps npm’s mocha package in Fibers.
It is the case that the version of mocha it’s using is old (2.4.5) vs the current version (5.0.0). As far as I can see, while there are some worthwhile improvements in mocha, I don’t think that there’s anything in practicalmeteor:mocha-core which should break in Meteor 1.6.1.
@diaconutheodorpublished a fork on atmosphere for practical mocha that is working with Meteor 1.6.1 (thanks!) and opened an issue at practical mocha repo. The guide is still recommending practical mocha and I think it’s great for testing especially with the browser report.
Hopefully practical mocha (or fork) gets maintained because it’s great to work with and switching to meteortesting:mocha as per the meteor 1.6.1 recommendation doesn’t seem to be a straight forward or desirable solution.
https://github.com/cult-of-coders/meteor-mocha – I just love practicalmeteor:mocha it’s so simple, so elegant to test and see results. I think it’s perfect the way it is I’ll make sure it’ll work on future Meteor releases