MCPcopy Create free account
hub / github.com/decaporg/decap-cms / testBrowserCompatibility

Function testBrowserCompatibility

scripts/test-package-integrity.mjs:208–225  ·  view source on GitHub ↗

* Test that a package doesn't have browser-incompatible code

(packageName)

Source from the content-addressed store, hash-verified

206 * Test that a package doesn't have browser-incompatible code
207 */
208function testBrowserCompatibility(packageName) {
209 const packageDir = join(ROOT_DIR, 'packages', packageName);
210
211 log(`Checking browser compatibility for ${packageName}...`);
212
213 const { ok, issues } = checkDistForNodeProtocol(packageDir);
214
215 if (!ok) {
216 error(`Browser compatibility issues in ${packageName}:`);
217 for (const issue of issues) {
218 error(` ${issue.file}: contains ${issue.pattern}`);
219 }
220 return false;
221 }
222
223 log(` Browser compatibility OK for ${packageName}`);
224 return true;
225}
226
227/**
228 * Test that the package.json has required fields

Callers 1

mainFunction · 0.85

Calls 3

checkDistForNodeProtocolFunction · 0.85
logFunction · 0.70
errorFunction · 0.70

Tested by

no test coverage detected