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

Function testBrowserCompatibility

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

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

(packageName)

Source from the content-addressed store, hash-verified

109 * Test that a package doesn't have browser-incompatible code
110 */
111function testBrowserCompatibility(packageName) {
112 const packageDir = join(ROOT_DIR, 'packages', packageName);
113
114 log(`Checking browser compatibility for ${packageName}...`);
115
116 const { ok, issues } = checkDistForNodeProtocol(packageDir);
117
118 if (!ok) {
119 error(`Browser compatibility issues in ${packageName}:`);
120 for (const issue of issues) {
121 error(` ${issue.file}: contains ${issue.pattern}`);
122 }
123 return false;
124 }
125
126 log(` Browser compatibility OK for ${packageName}`);
127 return true;
128}
129
130/**
131 * Test that the package.json has required fields

Callers 1

mainFunction · 0.85

Calls 3

logFunction · 0.85
checkDistForNodeProtocolFunction · 0.85
errorFunction · 0.85

Tested by

no test coverage detected