adopted-ember-addons / ember-electron

:zap: Build, test, compile and package desktop apps with Ember and Electron
https://ember-electron.js.org/
Other
805 stars 109 forks source link

ember electron:test fails on fresh setup #18

Closed brettchalupa closed 8 years ago

brettchalupa commented 8 years ago

Hi! I am working on a little app w/ ember-electron, so I setup a new Ember app with:

npm install -g ember-cli
ember new foo

I then installed ember-electron with:

ember install ember-electron

I followed the configuration steps, and then I ran ember electron:test. The following error was raised:

gondor:brettchalupa foo $ ember electron:test
Cannot find module 'quick-temp'
Error: Cannot find module 'quick-temp'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Class.module.exports.init (/Users/brettchalupa/workspace/donely/node_modules/ember-electron/lib/commands/electron-test/index.js:51:26)
    at new Class (/Users/brettchalupa/workspace/donely/node_modules/ember-cli/node_modules/core-object/core-object.js:18:12)
    at CLI.<anonymous> (/Users/brettchalupa/workspace/donely/node_modules/ember-cli/lib/cli/cli.js:41:19)
    at lib$rsvp$$internal$$tryCatch (/Users/brettchalupa/workspace/donely/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:493:16)
    at lib$rsvp$$internal$$invokeCallback (/Users/brettchalupa/workspace/donely/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:505:17)
    at lib$rsvp$$internal$$publish (/Users/brettchalupa/workspace/donely/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:476:11)
    at lib$rsvp$asap$$flush (/Users/brettchalupa/workspace/donely/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1198:9)
    at process._tickCallback (node.js:355:11)

The ember test command runs as expected.

Some additional info:

Running the command npm install quick-temp --save-dev fixed the issue and tests now pass when running ember electron:test.

Is the issue something on my end or is it something as straightforward as adding quick-temp to the ember-electron dependencies? I am happy to contribute the fix and help figure it out. Thanks! :smile:

brettchalupa commented 8 years ago

After doing a little more digging, as the error trace shows, the require here https://github.com/felixrieseberg/ember-electron/blob/39a83802b404e3786a4f9cbf789098dcccfd25e1/lib/commands/electron-test/index.js#L51 seems to be the problem. I forked and cloned the repo, and I will try to submit a fix!

felixrieseberg commented 8 years ago

Oh wow, thank you very much for the report, the investigation, and the fix!

brettchalupa commented 8 years ago

Just to check that this worked, I created a new Ember app with v0.3.4 of ember-electron and ember electron:test worked as expected! :tada: