Skip to content

Commit 09ac2a2

Browse files
sam-githubitaloacasas
authored andcommitted
doc: specify sorted requires in tests
And allow anchor links to the various sections, to more easily reference them when reviewing PRs. PR-URL: #10716 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]>
1 parent da57213 commit 09ac2a2

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

doc/guides/writing-tests.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ Let's analyze this basic test from the Node.js test suite:
2929
4 // This test ensures that the http-parser can handle UTF-8 characters
3030
5 // in the http header.
3131
6
32-
7 const http = require('http');
33-
8 const assert = require('assert');
32+
7 const assert = require('assert');
33+
8 const http = require('http');
3434
9
3535
10 const server = http.createServer(common.mustCall((req, res) => {
3636
11 res.end('ok');
@@ -46,7 +46,7 @@ Let's analyze this basic test from the Node.js test suite:
4646
21 });
4747
```
4848

49-
**Lines 1-2**
49+
### **Lines 1-2**
5050

5151
```javascript
5252
'use strict';
@@ -70,7 +70,7 @@ assigning it to an identifier:
7070
require('../common');
7171
```
7272

73-
**Lines 4-5**
73+
### **Lines 4-5**
7474

7575
```javascript
7676
// This test ensures that the http-parser can handle UTF-8 characters
@@ -80,11 +80,11 @@ require('../common');
8080
A test should start with a comment containing a brief description of what it is
8181
designed to test.
8282

83-
**Lines 7-8**
83+
### **Lines 7-8**
8484

8585
```javascript
86-
const http = require('http');
8786
const assert = require('assert');
87+
const http = require('http');
8888
```
8989

9090
The test checks functionality in the `http` module.
@@ -95,7 +95,7 @@ The require statements are sorted in
9595
[ASCII](http://man7.org/linux/man-pages/man7/ascii.7.html) order (digits, upper
9696
case, `_`, lower case).
9797

98-
**Lines 10-21**
98+
### **Lines 10-21**
9999

100100
This is the body of the test. This test is simple, it just tests that an
101101
HTTP server accepts `non-ASCII` characters in the headers of an incoming

0 commit comments

Comments
 (0)