Skip to content

Commit

Permalink
Use async fs on new linecounter tests (#1446)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jasper De Moor authored and fathyb committed May 28, 2018
1 parent 181a63f commit 9861c46
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions 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
Expand All @@ -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);
});
});

0 comments on commit 9861c46

Please sign in to comment.