Closed juliendorra closed 6 years ago
@jonathanperret @etienneCharignon I can now test locally \o/ but I'n confounded by this test failing:
not ok 1 PhantomJS 2.1 - The Paysage programmer generates a random creature name on initialization (as once again it works in the browser, and I can't find at first glance the source of the undefined error in the test itsefl)
message: > TypeError: undefined is not an object (evaluating 'window.Paysage.programmerInit') in http://localhost:7357/spec/public/programmer_spec.js (line 8) stack: > http://localhost:7357/spec/public/programmer_spec.js:8:19 attemptSync@http://cdnjs.cloudflare.com/ajax/libs/jasmine/2.4.1/jasmine.js:1886:28 run@http://cdnjs.cloudflare.com/ajax/libs/jasmine/2.4.1/jasmine.js:1874:20 execute@http://cdnjs.cloudflare.com/ajax/libs/jasmine/2.4.1/jasmine.js:1859:13 queueRunnerFactory@http://cdnjs.cloudflare.com/ajax/libs/jasmine/2.4.1/jasmine.js:697:42 execute@http://cdnjs.cloudflare.com/ajax/libs/jasmine/2.4.1/jasmine.js:359:28 fn@http://cdnjs.cloudflare.com/ajax/libs/jasmine/2.4.1/jasmine.js:2479:44 attemptAsync@http://cdnjs.cloudflare.com/ajax/libs/jasmine/2.4.1/jasmine.js:1916:28 run@http://cdnjs.cloudflare.com/ajax/libs/jasmine/2.4.1/jasmine.js:1871:21 execute@http://cdnjs.cloudflare.com/ajax/libs/jasmine/2.4.1/jasmine.js:1859:13 queueRunnerFactory@http://cdnjs.cloudflare.com/ajax/libs/jasmine/2.4.1/jasmine.js:697:42 fn@http://cdnjs.cloudflare.com/ajax/libs/jasmine/2.4.1/jasmine.js:2464:31 attemptAsync@http://cdnjs.cloudflare.com/ajax/libs/jasmine/2.4.1/jasmine.js:1916:28 run@http://cdnjs.cloudflare.com/ajax/libs/jasmine/2.4.1/jasmine.js:1871:21 execute@http://cdnjs.cloudflare.com/ajax/libs/jasmine/2.4.1/jasmine.js:1859:13 queueRunnerFactory@http://cdnjs.cloudflare.com/ajax/libs/jasmine/2.4.1/jasmine.js:697:42 execute@http://cdnjs.cloudflare.com/ajax/libs/jasmine/2.4.1/jasmine.js:2326:25 execute@http://cdnjs.cloudflare.com/ajax/libs/jasmine/2.4.1/jasmine.js:757:24 onload@http://cdnjs.cloudflare.com/ajax/libs/jasmine/2.4.1/boot.js:141:16
I can now test locally \o/
The universe lets out a sigh as the Force is balanced again. 🍾 😂
If you are investigating a browser-side spec (those tests living in spec/public
) failure, you have to know a few things:
npm test
run, Testem is told to launch PhantomJS and exit once the test suite is complete ;npm run testem
. This will start the Testem UI in your terminal and launch a PhantomJS instance to auto-run the tests. You can then open the URL that Testem gives you in your favorite browser and see the tests running, which allows you to debug them for example ;testem.yml
. Because the Paysage server is not involved in these client-only tests, when renaming JS files it is not enough to change the hbs
templates in views/
.I just merged #95 that adds a bunch of this kind of tests. I suggest rebasing (please don't merge master
, it creates a hairy mess in the history) onto origin/master
before attempting to fix your broken test.
Hope this helps!
Thanks, it does help! It would be useful for potential contributors to have this kind of hints/summary on our test process in the wiki, linked from the readme.
Great, now try this:
$ git checkout focus-in-editor-after-Go-Live
$ git fetch # make sure to have the laster master
$ git rebase -i origin/master
# in the editor, replace every "pick" except the first with "squash", save, exit
# the rebase stops on the last commit because of the conflict on testem.yml
$ vim testem.yml
# fix conflict, save, exit
$ git add testem.yml # tell git the conflict is resolved
$ git rebase --continue
# clean up the commit message, don't forget to add "Fixes #71" somewhere
$ git push --force-with-lease # replace this PR's commits with the clean one
Oh, and there are a couple comments in other JS files that say Requires a codeinitialization script…
, might want to do something about that.
I think it's ready for merging. Anything more?
Thanks!
We focus back to the editor in the cases of clicking [Go Live!] and clicking an example – allowing the users to resume their programming flow without moving the mouse/finger to the editor space and clicking/taping. Segregated in a new ui management JS file.