MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / getFileContents

Function getFileContents

lib/helper/FileSystem.js:211–215  ·  view source on GitHub ↗

* @param {string} file * @param {string} [encoding='utf8'] * @private * @returns {string}

(file, encoding = 'utf8')

Source from the content-addressed store, hash-verified

209 * @returns {string}
210 */
211function getFileContents(file, encoding = 'utf8') {
212 if (!file) assert.fail('No files were opened, please use seeFile action')
213 if (encoding === '') assert.fail('Encoding is an empty string, please set a valid encoding')
214 return fs.readFileSync(file, encoding)
215}
216
217/**
218 * @param {string} file

Callers 5

seeInThisFileMethod · 0.85
dontSeeInThisFileMethod · 0.85
seeFileContentsEqualMethod · 0.85

Calls 1

failMethod · 0.80

Tested by

no test coverage detected