I’ve just upgraded to Meteor 1.6 and now my tests won’t work in the browser.
The following command:
meteor test --driver-package practicalmeteor:mocha --port 3100
Gives the following error in the dev console:
index.js:11 Uncaught TypeError: MochaRunner.runEverywhere is not a function
at Object.runTests (index.js:11)
at meteor.js?hash=6d285d84547b3dad9717a7c89c664b61b45ea3d8:1040
at maybeReady (meteor.js?hash=6d285d84547b3dad9717a7c89c664b61b45ea3d8:821)
at HTMLDocument.loadingCompleted (meteor.js?hash=6d285d84547b3dad9717a7c89c664b61b45ea3d8:833)
However, the test run OK with phantom js.
Any suggestions as to what the problem might be?
1 Like
Upgrade to meteortesting:mocha
and try again
3 Likes
Thanks for that. I also needed to remove both disptach:mocha and practicalmeteor:mocha for it to work, but I’m there now.
It’s a shame we don’t see server tests in the browser anymore, but I’m just glad it works.
It’s strange that this isn’t mentioned in the changelog of 1.6, although the impact can be big for heavy mocha users.
It’s also strange that without updating to 1.6 the new meteor-tool downloads in the background breaking existings tests.
I’ll file an issue once I’m on my laptop.
Thanks for the hint!
Just like to mention that this doesn’t solve meteor test-packages
:
@abernix @benjamn
In #7500, it says that peer package deps work with test-packages after 1.4.1. I confirmed this, but they don't work...
bug
confirmed
Impact:some
pull-requests-encouraged
Severity:has-workaround
I updated the meteor coffee script package to the very latest and it works even with the older practicalmeteor:mocha package.
3 Likes
jamiter
November 2, 2017, 12:36pm
7
Awesome, thanks!
This worked for me:
Package.onTest(function test(api) {
api.use(packages);
api.use([
'coffeescript@1.12.7_3',
'practicalmeteor:mocha@2.4.5_6',
'dispatch:phantomjs-tests@=0.0.5',
'dispatch:mocha-phantomjs',
]);
api.mainModule('specs/client.spec.js', 'client');
api.mainModule('specs/server.spec.js', 'server');
});
Further test setup can be found here:
jkhile
November 3, 2017, 12:08am
8
Thanks for this. Worked for me too. Updated coffeescript with ‘meteor update coffeescript’ and practicalmeteor:mocha came back to life.
3 Likes
joely
November 17, 2017, 11:36am
9
Yes, for me too. Thanks so much for the solution. (That one drove me crazy)