MCPcopy Create free account
hub / github.com/TypeStrong/tsify / expectFiles

Function expectFiles

test/test.js:811–830  ·  view source on GitHub ↗
(t, emitted, expected)

Source from the content-addressed store, hash-verified

809}
810
811function expectFiles(t, emitted, expected) {
812
813 Object.keys(expected).forEach(function (key) {
814 var index = findIndex(key);
815 if (expected[key]) {
816 t.notEqual(index, -1, 'Should emit ' + key);
817 } else {
818 t.equal(index, -1, 'Should not emit ' + key);
819 }
820 });
821
822 function findIndex(file) {
823 for (var i = 0; i < emitted.length; ++i) {
824 if (new RegExp(file + '$').test(emitted[i])) {
825 return i;
826 }
827 }
828 return -1;
829 }
830}

Callers 1

test.jsFile · 0.85

Calls 2

findIndexFunction · 0.85
forEachMethod · 0.80

Tested by

no test coverage detected