@@ -23,27 +23,27 @@ Add tests when:
2323Let's analyze this basic test from the Node.js test suite:
2424
2525``` javascript
26- 1 ' use strict' ;
27- 2 const common = require (' ../common' );
28- 3
29- 4 // This test ensures that the http-parser can handle UTF-8 characters
30- 5 // in the http header.
31- 6
32- 7 const assert = require (' assert' );
33- 8 const http = require (' http' );
34- 9
35- 10 const server = http .createServer (common .mustCall ((req , res ) => {
36- 11 res .end (' ok' );
37- 12 }));
38- 13 server .listen (0 , () => {
39- 14 http .get ({
40- 15 port: server .address ().port ,
41- 16 headers: {' Test' : ' Düsseldorf' }
42- 17 }, common .mustCall ((res ) => {
43- 18 assert .strictEqual (res .statusCode , 200 );
44- 19 server .close ();
45- 20 }));
46- 21 });
26+ ' use strict' ; // 1
27+ const common = require (' ../common' ); // 2
28+ // 3
29+ // This test ensures that the http-parser can handle UTF-8 characters // 4
30+ // in the http header. // 5
31+ // 6
32+ const assert = require (' assert' ); // 7
33+ const http = require (' http' ); // 8
34+ // 9
35+ const server = http .createServer (common .mustCall ((req , res ) => { // 10
36+ res .end (' ok' ); // 11
37+ })); // 12
38+ server .listen (0 , () => { // 13
39+ http .get ({ // 14
40+ port: server .address ().port , // 15
41+ headers: {' Test' : ' Düsseldorf' } // 16
42+ }, common .mustCall ((res ) => { // 17
43+ assert .strictEqual (res .statusCode , 200 ); // 18
44+ server .close (); // 19
45+ })); // 20
46+ }); // 21
4747```
4848
4949### ** Lines 1-2**
0 commit comments