VulcanJS / Vulcan

🌋 A toolkit to quickly build apps with React, GraphQL & Meteor
http://vulcanjs.org
MIT License
7.98k stars 1.88k forks source link

Error trying to run client unit tests #2324

Closed ErikDakoda closed 5 years ago

ErikDakoda commented 5 years ago

When I run the test script in package.json all unit tests run and pass:

  60 passing (473ms)
  20 pending

But I see the following message at the bottom:

Load the app in a browser to run client tests, or set the TEST_BROWSER_DRIVER environment variable. See https://github.com/meteortesting/meteor-mocha/blob/master/README.md#run-app-tests

When I load the app in a browser at http://localhost:3002/ I get a 500 error page and the test console logs:

{"line":"1010","file":"webapp_server.js","message":"Error running template: TypeError: Cannot set property 'loader' of undefined\n
    at Collections.forEach.collection (packages/vulcan:lib/lib/server/apollo-server/context.js:66:5)\n
    at Array.forEach (<anonymous>)\n    at generateDataLoaders (packages/vulcan:lib/lib/server/apollo-server/context.js:65:15)\n
    at Promise.asyncApply (packages/vulcan:lib/lib/server/apollo-server/context.js:95:5)\n
    at /Users/erik/.meteor/packages/promise/.0.11.2.1t6szur.5e61++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/meteor-promise/fiber_pool.js:43:40\n => awaited here:\n
    at Function.Promise.await (/Users/erik/.meteor/packages/promise/.0.11.2.1t6szur.5e61++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/meteor-promise/promise_server.js:56:12)\n
    at Promise.asyncApply (packages/vulcan:lib/lib/server/apollo-ssr/apolloClient.js:29:16)\n
    at /Users/erik/.meteor/packages/promise/.0.11.2.1t6szur.5e61++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/meteor-promise/fiber_pool.js:43:40\n => awaited here:\n
    at Function.Promise.await (/Users/erik/.meteor/packages/promise/.0.11.2.1t6szur.5e61++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/meteor-promise/promise_server.js:56:12)\n
    at Promise.asyncApply (packages/vulcan:lib/lib/server/apollo-ssr/renderPage.js:24:17)\n
    at /Users/erik/.meteor/packages/promise/.0.11.2.1t6szur.5e61++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/meteor-promise/fiber_pool.js:43:40","time":{"$date":1559301061644},"level":"error"}

Are you guys able to run the client tests with no errors?

eric-burel commented 5 years ago

No sorry I never managed to and I've limited myself to server side testing (thanks to SSR it's ok for most tests) :/ But I had a first issue with running Chromium which was related to Linux. I'll retry asap.

eric-burel commented 5 years ago

This is one reason why I want to move to Jest for client side tests

eric-burel commented 5 years ago

Should be fixed by https://github.com/VulcanJS/Vulcan/pull/2349