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