Skip to content

Instructions in testing guide fail to run client tests from the command line #8225

@danstiner

Description

@danstiner

While following the instructions in the testing guide for configuring command line execution using PhantomJS (https://guide.meteor.com/testing.html) I consistently see the error message cannot execute binary file when running client tests. This seems to be because the phantomjs being installed is for MacOS but I am running Linux x64.

Steps to reproduce on a Linux machine:

curl https://install.meteor.com/ | sh
meteor create phantomjs-tests
cd phantomjs-tests/
meteor npm install --save babel-runtime
meteor add dispatch:mocha-phantomjs
meteor test --once --driver-package dispatch:mocha-phantomjs

Resulting output:

--------------------------------
----- RUNNING CLIENT TESTS -----
--------------------------------

/home/dan/.meteor/packages/dispatch_phantomjs-tests/.0.0.7.1k3403j++os+web.browser+web.cordova/npm/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs: /home/dan/.meteor/packages/dispatch_phantomjs-tests/.0.0.7.1k3403j++os+web.browser+web.cordova/npm/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs: cannot execute binary file

Running file on the binary indicates it is actually a Mach-O executable meant for MacOS:

$ file /home/dan/.meteor/packages/dispatch_phantomjs-tests/.0.0.7.1k3403j++os+web.browser+web.cordova/npm/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs
Mach-O 64-bit x86_64 executable, flags:<NOUNDEFS|DYLDLINK|TWOLEVEL|BINDS_TO_WEAK|PIE>

This can be worked around by running the following, which leads me to believe this is an issue with meteor not correctly doing the rebuild, and that this is not an issue with the phantomjs-tests package.

cd /home/dan/.meteor/packages/dispatch_phantomjs-tests/.0.0.7.1k3403j++os+web.browser+web.cordova/npm
npm rebuild

Related discussion on Dispatch-Archive/meteor-mocha-phantomjs#35

Meteor 1.4.2.3
dispatch:mocha-phantomjs@0.1.9
dispatch:phantomjs-tests@0.0.7
x86_64 GNU/Linux

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions