* Test that a package doesn't have browser-incompatible code
(packageName)
| 206 | * Test that a package doesn't have browser-incompatible code |
| 207 | */ |
| 208 | function 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 |
no test coverage detected