MCPcopy Index your code
hub / github.com/loopbackio/loopback-next / assertFilesToMatchSnapshot

Function assertFilesToMatchSnapshot

packages/cli/test/snapshots.js:30–44  ·  view source on GitHub ↗

* Assert a list of files to match snapshots * @param {object} options Options * - exists: assert the file exists or not * - rootPath: rootPath for file names * @param {...string} files

(options, ...files)

Source from the content-addressed store, hash-verified

28 * @param {...string} files
29 */
30function assertFilesToMatchSnapshot(options, ...files) {
31 options = {exists: true, ...options};
32 if (options.rootPath) {
33 files = files.map(f => path.resolve(options.rootPath, f));
34 }
35
36 for (const f of files) {
37 if (options.exists === false) {
38 assert.noFile(f);
39 break;
40 }
41 assert.file(f);
42 expectFileToMatchSnapshot(f);
43 }
44}
45
46module.exports = {
47 expectToMatchSnapshot,

Callers 5

assertFilesFunction · 0.85
assertFilesFunction · 0.85
assertFilesFunction · 0.85
app.integration.jsFile · 0.85
assertFilesFunction · 0.85

Calls 2

resolveMethod · 0.80

Tested by

no test coverage detected