1 | ## Thank you!
|
2 |
|
3 | Before anything else, thank you. Thank you for taking some of your precious time helping this project move forward.
|
4 |
|
5 | This guide will help you get started with Cucumber.js's development environment. You'll also find the set of rules you're expected to follow in order to submit improvements and fixes to Cucumber.js.
|
6 |
|
7 | ## Get started
|
8 |
|
9 | After forking and cloning the repository, install the required dependencies:
|
10 |
|
11 | $ cd <path/to/cucumber-js>
|
12 | $ npm link
|
13 |
|
14 | ## Play
|
15 |
|
16 | $ node example/server.js
|
17 |
|
18 | Then go to [localhost:9797](http://localhost:9797/) to see the little web demo.
|
19 |
|
20 | ## Tests
|
21 |
|
22 | There are two set of tests resulting from the BDD approach we've been applying to Cucumber.js from the beginning.
|
23 |
|
24 | * full-stack tests (outside): surprisingly those are Gherkin scenarios;
|
25 | * unit tests (inside): jasmine specs.
|
26 |
|
27 | ### Specs
|
28 |
|
29 | Run the specs:
|
30 |
|
31 | $ npm i && npm test
|
32 |
|
33 | ### Debug messages
|
34 |
|
35 | You can display debug messages by setting the DEBUG_LEVEL environment variable. It goes from `1` to `5`. `5` will display everything, `1` will only print out the critical things.
|
36 |
|
37 | $ DEBUG_LEVEL=5 ./bin/cucumber.js
|
38 |
|
39 |
|
40 | ## Coding guidelines
|
41 |
|
42 | If you plan on submitting code, read this carefully. Please note it is not yet complete.
|
43 |
|
44 | We stick to the [Google JavaScript Style Guide](http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml).
|
45 |
|
46 | In addition to those syntactic rules, we apply the following principles:
|
47 |
|
48 | ### Write expressive method and function names
|
49 |
|
50 | Use expressive names. Express arguments as part of the method/function name. Someone calling it should be able to infer the expected arguments only from the name. They shouldn't have to check the method/function definition.
|
51 |
|
52 | ``` javascript
|
53 | adorn(/* ... */) // BAD: it does not tell anything about its
|
54 | // parameters, you'll need to read the method
|
55 | // definition to know the arguments.
|
56 |
|
57 | addStyleToText(/* ... */) // you can fairly guess this function
|
58 | // accepts "style" and "text" arguments:
|
59 | ```
|
60 |
|
61 | ** WORK IN PROGRESS **
|
62 |
|
63 | ## Release checklist
|
64 |
|
65 | This a reminder of the steps maintainers have to follow to release a new version of Cucumber.js.
|
66 |
|
67 | * Update `History.md`. `git log --format=format:"* %s (%an)" --reverse <last-version-tag>..HEAD` might be handy.
|
68 | * Bump version in `lib/cucumber.js`
|
69 | * Bump version in `package.json`
|
70 | * Compile the bundle with `npm run build-release`
|
71 | * Add new contributors to `package.json`, if any
|
72 | * Commit those changes as "*Release 0.1.2*" (where *0.1.2* is the actual version, of course)
|
73 | * Tag commit as "v0.1.2" with a description of the major changes introduced. API changes must be documented. In particular, backward-incompatible changes must be well explained, with examples when possible.
|
74 | * Push to main repo on GitHub
|
75 | * Wait for build to go green
|
76 | * Publish to NPM
|