OLD | NEW |
1 Hacking on Sky | 1 Hacking on Sky |
2 ============== | 2 ============== |
3 | 3 |
4 Building | 4 Building |
5 -------- | 5 -------- |
6 | 6 |
7 * Follow the setup & build instructions for [mojo](https://github.com/domokit/mo
jo) | 7 * Follow the setup & build instructions for [Mojo](https://github.com/domokit/mo
jo) |
8 * Build ``sky`` with ``ninja``, e.g. ``ninja -C out/Debug sky`` | 8 * Build ``sky`` with ``ninja``, e.g. ``ninja -C out/Debug sky`` |
9 | 9 |
10 Running applications | 10 Running applications |
11 -------------------- | 11 -------------------- |
12 | 12 |
13 * ``./sky/tools/skydb --debug`` | 13 * ``./sky/tools/skydb [url]`` |
14 * You should see a ``(skydb)`` prompt | 14 * You should see a ``(skydb)`` prompt |
15 * Type ``help`` to see the list of available commands | 15 * Type ``help`` to see the list of available commands |
16 * The most common command is to load a URL, which youc an do simply by typing | |
17 the URL. To reload the current page, type enter. | |
18 | 16 |
19 * ``./sky/tools/test_sky --debug`` | 17 * ``./sky/tools/test_sky --debug`` |
20 * This should run the tests | 18 * This should run the tests |
21 | 19 |
22 Running tests manually | 20 Running tests manually |
23 ---------------------------- | 21 ---------------------- |
24 | 22 |
25 * ``sky/tools/run_sky_httpd`` | 23 * ``sky/tools/run_sky_httpd`` |
26 * ``out/Debug/mojo_shell --args-for="mojo://native_viewport_service/ --use-head
less-config" --content-handlers=text/html,mojo://sky_viewer/ --url-mappings=mojo
:window_manager=mojo:sky_tester mojo:window_manager`` | 24 * ``out/Debug/mojo_shell --args-for="mojo://native_viewport_service/ --use-headl
ess-config" --content-handlers=text/html,mojo://sky_viewer/ --url-mappings=mojo:
window_manager=mojo:sky_tester mojo:window_manager`` |
27 * The ``sky_tester`` should print ``#READY`` when ready | 25 * The ``sky_tester`` should print ``#READY`` when ready |
28 * Type the URL you wish to run, for example ``http://127.0.0.1:8000/lowlevel/te
xt.html``, and press the enter key | 26 * Type the URL you wish to run, for example ``http://127.0.0.1:8000/lowlevel/tex
t.html``, and press the enter key |
29 * The harness should print the results of the test. You can then type another
URL. | 27 * The harness should print the results of the test. You can then type another U
RL. |
30 | 28 |
31 Writing tests | 29 Writing tests |
32 ------------- | 30 ------------- |
33 | 31 |
34 * Import ``tests/http/tests/resources/mocha.html`` | 32 * Import ``resources/mocha.html`` and ``resources/chai.html`` |
35 * Write tests in [mocha format](http://visionmedia.github.io/mocha/#getting-star
ted) and use [chai asserts](http://chaijs.com/api/assert/): | 33 * Write tests in [mocha format](http://visionmedia.github.io/mocha/#getting-star
ted) and use [chai asserts](http://chaijs.com/api/assert/): |
36 ``` | 34 ```html |
37 describe('My pretty test of my subject', function() { | 35 describe('My pretty test of my subject', function() { |
38 var subject = new MySubject(); | 36 var subject = new MySubject(); |
39 | 37 |
40 it('should be pretty', function() { | 38 it('should be pretty', function() { |
41 assert.ok(subject.isPretty); | 39 assert.ok(subject.isPretty); |
42 }); | 40 }); |
43 | |
44 }); | 41 }); |
45 ``` | 42 ``` |
OLD | NEW |