lib/parsers.js
function loadFileData(fileName) {
    var testConfig = this.testConfig;
    if (!testConfig) {
        throw new Error('No test configuration found.\n' +
            'You can add one by adding a property called `testConfig` to the word object.');
    }
    var testDataRoot = testConfig.testDataRoot;
    if (!testDataRoot) {
        throw new Error('No test data root path found.\n' +
            'You can add one by adding a property called `testDataRoot` to the test configuration.');
    }
    var filePath = path.join(testDataRoot, fileName);
    this._log.trace({ path: filePath }, 'Loading file.');

    //Don't use `require` because that caches the returned object.
    var value = require('fs').createReadStream(filePath);
    this._log.trace({ loadedData: value }, 'File loaded.');
    return value;
}
function loadFileData(fileName) {
    var testConfig = this.testConfig;
    if (!testConfig) {
        throw new Error('No test configuration found.\n' +
            'You can add one by adding a property called `testConfig` to the word object.');
    }
    var testDataRoot = testConfig.testDataRoot;
    if (!testDataRoot) {
        throw new Error('No test data root path found.\n' +
            'You can add one by adding a property called `testDataRoot` to the test configuration.');
    }
    var filePath = path.join(testDataRoot, fileName);
    this._log.trace({ path: filePath }, 'Loading file.');

    //Don't use `require` because that caches the returned object.
    var value = require('fs').createReadStream(filePath);
    this._log.trace({ loadedData: value }, 'File loaded.');
    return value;
}
function loadFileData ( fileName ) { var testConfig = this . testConfig ; if ( ! testConfig ) { throw new Error ( 'No test configuration found.\n' + 'You can add one by adding a property called `testConfig` to the word object.' ) ; } var testDataRoot = testConfig . testDataRoot ; if ( ! testDataRoot ) { throw new Error ( 'No test data root path found.\n' + 'You can add one by adding a property called `testDataRoot` to the test configuration.' ) ; } var filePath = path . join ( testDataRoot , fileName ) ; this . _log . trace ( { path : filePath } , 'Loading file.' ) ; //Don't use `require` because that caches the returned object. var value = require ( 'fs' ) . createReadStream ( filePath ) ; this . _log . trace ( { loadedData : value } , 'File loaded.' ) ; return value ; }
This function expects a full fileName with extension included!
This function expects a full fileName with extension included!