From 9861c46b2cff1c32c5d20f33ff59441b2630ec0e Mon Sep 17 00:00:00 2001 From: Jasper De Moor Date: Mon, 28 May 2018 06:00:34 +0200 Subject: [PATCH] Use async fs on new linecounter tests (#1446) --- test/lineCounter.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/lineCounter.js b/test/lineCounter.js index 5d2e59a26ff..1fb8a37be0c 100644 --- a/test/lineCounter.js +++ b/test/lineCounter.js @@ -1,8 +1,8 @@ -const fs = require('fs'); +const fs = require('../src/utils/fs'); const assert = require('assert'); const lineCounter = require('../src/utils/lineCounter'); -describe('line counter', () => { +describe('line counter', async function() { it('counts number of lines of a string', () => { const input = ` line 1 line 2 @@ -11,8 +11,8 @@ describe('line counter', () => { assert(lineCounter(input) === 3); }); - it('counts number of lines of a file from disk', () => { - const input = fs.readFileSync('./test/lineCounter.js').toString(); + it('counts number of lines of a file from disk', async function() { + const input = (await fs.readFile('./test/lineCounter.js')).toString(); assert(lineCounter(input) === 19); }); });