All files / ember-web-app/node-tests/acceptance/helpers index.js

37.5% Statements 3/8
100% Branches 0/0
0% Functions 0/5
42.86% Lines 3/7

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19  1x 1x   1x                            
'use strict';
const assert = require('assert');
const fs = require('fs');
 
module.exports = { contentOf, exists, assertJSON };
 
function contentOf(app, path) {
  return () => fs.readFileSync(app.filePath(path), { encoding: 'utf-8' });
}
 
function exists(app, path) {
  return fs.existsSync(app.filePath(path));
}
 
function assertJSON(app, expected) {
  return actual =>
    assert.deepStrictEqual(JSON.parse(actual), expected, 'assert JSON');
}