From b6d293d2158c66a3edbb86c0c43b4c51af3484f7 Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Fri, 21 Apr 2017 07:53:00 +0300 Subject: doc: prepare js code for eslint-plugin-markdown This is an initial step to eliminate most of parsing errors. PR-URL: https://github.com/nodejs/node/pull/12563 Refs: https://github.com/nodejs/node/pull/12557#issuecomment-296015032 Reviewed-By: Teddy Katz Reviewed-By: James M Snell Reviewed-By: Timothy Gu Reviewed-By: Gibson Fahnestock Reviewed-By: Yuta Hiroto --- doc/guides/writing-tests.md | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'doc/guides/writing-tests.md') diff --git a/doc/guides/writing-tests.md b/doc/guides/writing-tests.md index d0a6e1a199..70690e2fda 100644 --- a/doc/guides/writing-tests.md +++ b/doc/guides/writing-tests.md @@ -23,27 +23,27 @@ Add tests when: Let's analyze this basic test from the Node.js test suite: ```javascript -1 'use strict'; -2 const common = require('../common'); -3 -4 // This test ensures that the http-parser can handle UTF-8 characters -5 // in the http header. -6 -7 const assert = require('assert'); -8 const http = require('http'); -9 -10 const server = http.createServer(common.mustCall((req, res) => { -11 res.end('ok'); -12 })); -13 server.listen(0, () => { -14 http.get({ -15 port: server.address().port, -16 headers: {'Test': 'Düsseldorf'} -17 }, common.mustCall((res) => { -18 assert.strictEqual(res.statusCode, 200); -19 server.close(); -20 })); -21 }); +'use strict'; // 1 +const common = require('../common'); // 2 + // 3 +// This test ensures that the http-parser can handle UTF-8 characters // 4 +// in the http header. // 5 + // 6 +const assert = require('assert'); // 7 +const http = require('http'); // 8 + // 9 +const server = http.createServer(common.mustCall((req, res) => { // 10 + res.end('ok'); // 11 +})); // 12 +server.listen(0, () => { // 13 + http.get({ // 14 + port: server.address().port, // 15 + headers: {'Test': 'Düsseldorf'} // 16 + }, common.mustCall((res) => { // 17 + assert.strictEqual(res.statusCode, 200); // 18 + server.close(); // 19 + })); // 20 +}); // 21 ``` ### **Lines 1-2** -- cgit v1.2.3