max-mapper / elementary-electron

NodeSchool workshop for learning Electron
228 stars 44 forks source link

Hello World Solution #16

Closed JoshuaMorris closed 8 years ago

JoshuaMorris commented 8 years ago

in the instructions it states to create a index.html

Using a text editor (such as TextEdit, Notepad, etc.), create a file
called index.html in the folder you just created with the following
contents:

<!DOCTYPE html>  
 <html>  
 <head>  
 </head>  
 <body>  
   <h1>Hello World</h1>  
 </body>  
 </html>  

running verification fails looking for a index.js

$ elementary-electron verify Checking Requirements:

» index.js [?]
» app.js ✔

FAIL!

Your app has some issues.

emilong commented 8 years ago

Any chance this will fix will be published to npm?

JoshuaMorris commented 8 years ago

I was not sure if the test should be corrected to look for index.html or if the instructions should be changed to tell the user to make a index.js. the next task uses index.html so i imagine its more of a test issue.

sparkleholic commented 8 years ago

I think you can modify the file in your local machine like this commit. https://github.com/maxogden/elementary-electron/commit/f49b4faf0e387b9789d13c4e57407aa9eb667da3

  problem.verify = function (args, cb) {
    checkAll([
      fsCheck(path.join('.', 'index.html')),
      fsCheck(path.join('.', 'app.js'))
    ], '{{exercise.hello_world.success}}', '{{exercise.hello_world.fail}}', cb)
  }
TylerMoeller commented 8 years ago

The fix by @sparkleholic worked for me. Windows 7 32-bit, Node 6.2.0, npm 3.10.5, elementary-electron 1.3.5

Line 12 of <global npm path>\node_modules\elementary-electron\exercises\hello_world\exercise.js

vicneanschi commented 8 years ago

Could you push this fix to npm please?

meadow-kun commented 8 years ago

Please push this fix to npm 👍

zeke commented 8 years ago

I can confirm that the latest npm package is not working, and is in fact different from what's on master right now.

https://github.com/maxogden/elementary-electron/blob/90e78ae69f9fb058e0d523a75346193196c52aa1/exercises/hello_world/exercise.js#L14

/usr/local/lib/node_modules/elementary-electron master
❯ cat /usr/local/lib/node_modules/elementary-electron/package.json | json version
1.3.5

/usr/local/lib/node_modules/elementary-electron master
❯ cat /usr/local/lib/node_modules/elementary-electron/exercises/hello_world/exercise.js | grep fsCheck
var fsCheck = require('../../lib/fsCheck.js')
      fsCheck(path.join('.', 'index.js')),
      fsCheck(path.join('.', 'app.js'))

I now have publish access to the npm package, and intend to get this update on npm right away. However I would like to land #21 first, to get the "tests" passing. It would be nice to make a habit of running tests before all releases. We can enforce that with CI (Travis?) andtools like np.

zeke commented 8 years ago
$ np patch

 ✔ Prerequisite check
 ✔ Git
 ✔ Cleanup
 ✔ Installing dependencies
 ✔ Running tests
 ✔ Bumping version
 ✔ Publishing package
 ✔ Pushing tags

 elementary-electron 1.3.6 published