@ -92,7 +92,7 @@ The test checks functionality in the `http` module.
Most tests use the `assert` module to confirm expectations of the test.
Most tests use the `assert` module to confirm expectations of the test.
The require statements are sorted in
The require statements are sorted in
[ASCII ](http://man7.org/linux/man-pages/man7/ascii.7.html ) order (digits, upper
[ASCII][] order (digits, upper
case, `_` , lower case).
case, `_` , lower case).
### **Lines 10-21**
### **Lines 10-21**
@ -231,9 +231,9 @@ assert.throws(
For performance considerations, we only use a selected subset of ES.Next
For performance considerations, we only use a selected subset of ES.Next
features in JavaScript code in the `lib` directory. However, when writing
features in JavaScript code in the `lib` directory. However, when writing
tests, for the ease of backporting, it is encouraged to use those ES.Next
tests, for the ease of backporting, it is encouraged to use those ES.Next
features that can be used directly without a flag in [all maintained branches]
features that can be used directly without a flag in
(https://github.com/nodejs/lts). [node.green ](http://node.green/ ) list s
[all maintained branches][]. [node.green][] lists available feature s
available features in each release.
in each release.
For example:
For example:
@ -258,8 +258,7 @@ functions worked correctly with the `beforeExit` event, then it might be named
### Web Platform Tests
### Web Platform Tests
Some of the tests for the WHATWG URL implementation (named
Some of the tests for the WHATWG URL implementation (named
`test-whatwg-url-*.js` ) are imported from the
`test-whatwg-url-*.js` ) are imported from the [Web Platform Tests Project][].
[Web Platform Tests Project ](https://github.com/w3c/web-platform-tests/tree/master/url ).
These imported tests will be wrapped like this:
These imported tests will be wrapped like this:
```js
```js
@ -332,13 +331,17 @@ $ make cctest
```
```
### Node test fixture
### Node test fixture
There is a [test fixture] named `node_test_fixture.h` which can be included by
There is a [test fixture][] named `node_test_fixture.h` which can be included by
unit tests. The fixture takes care of setting up the Node.js environment
unit tests. The fixture takes care of setting up the Node.js environment
and tearing it down after the tests have finished.
and tearing it down after the tests have finished.
It also contains a helper to create arguments to be passed into Node.js. It
It also contains a helper to create arguments to be passed into Node.js. It
will depend on what is being tested if this is required or not.
will depend on what is being tested if this is required or not.
[ASCII]: http://man7.org/linux/man-pages/man7/ascii.7.html
[Google Test]: https://github.com/google/googletest
[Google Test]: https://github.com/google/googletest
[Test fixture]: https://github.com/google/googletest/blob/master/googletest/docs/Primer.md#test-fixtures-using-the-same-data-configuration-for-multiple-tests
[Web Platform Tests Project]: https://github.com/w3c/web-platform-tests/tree/master/url
[`common` module]: https://github.com/nodejs/node/blob/master/test/common/README.md
[`common` module]: https://github.com/nodejs/node/blob/master/test/common/README.md
[all maintained branches]: https://github.com/nodejs/lts
[node.green]: http://node.green/
[test fixture]: https://github.com/google/googletest/blob/master/googletest/docs/Primer.md#test-fixtures-using-the-same-data-configuration-for-multiple-tests