mirror of
https://github.com/nodejs/node.git
synced 2026-11-25 23:01:06 -05:00
doc: specify sorted requires in tests
And allow anchor links to the various sections, to more easily reference them when reviewing PRs. PR-URL: https://github.com/nodejs/node/pull/10716 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
This commit is contained in:
1 parent
168f3e4bf8
commit
fa8a394e51
1 file changed
+7
-7
@@ -29,8 +29,8 @@ Let's analyze this basic test from the Node.js test suite:
|
||||
4 // This test ensures that the http-parser can handle UTF-8 characters
|
||||
5 // in the http header.
|
||||
6
|
||||
7 const http = require('http');
|
||||
8 const assert = require('assert');
|
||||
7 const assert = require('assert');
|
||||
8 const http = require('http');
|
||||
9
|
||||
10 const server = http.createServer(common.mustCall((req, res) => {
|
||||
11 res.end('ok');
|
||||
@@ -46,7 +46,7 @@ Let's analyze this basic test from the Node.js test suite:
|
||||
21 });
|
||||
```
|
||||
|
||||
**Lines 1-2**
|
||||
### **Lines 1-2**
|
||||
|
||||
```javascript
|
||||
'use strict';
|
||||
@@ -70,7 +70,7 @@ assigning it to an identifier:
|
||||
require('../common');
|
||||
```
|
||||
|
||||
**Lines 4-5**
|
||||
### **Lines 4-5**
|
||||
|
||||
```javascript
|
||||
// This test ensures that the http-parser can handle UTF-8 characters
|
||||
@@ -80,11 +80,11 @@ require('../common');
|
||||
A test should start with a comment containing a brief description of what it is
|
||||
designed to test.
|
||||
|
||||
**Lines 7-8**
|
||||
### **Lines 7-8**
|
||||
|
||||
```javascript
|
||||
const http = require('http');
|
||||
const assert = require('assert');
|
||||
const http = require('http');
|
||||
```
|
||||
|
||||
The test checks functionality in the `http` module.
|
||||
@@ -95,7 +95,7 @@ The require statements are sorted in
|
||||
[ASCII](http://man7.org/linux/man-pages/man7/ascii.7.html) order (digits, upper
|
||||
case, `_`, lower case).
|
||||
|
||||
**Lines 10-21**
|
||||
### **Lines 10-21**
|
||||
|
||||
This is the body of the test. This test is simple, it just tests that an
|
||||
HTTP server accepts `non-ASCII` characters in the headers of an incoming
|
||||
|
||||
Reference in new issue
Block a user