* Test that a package can be packed without errors
(packageName)
| 84 | * Test that a package can be packed without errors |
| 85 | */ |
| 86 | function testPackagePack(packageName) { |
| 87 | const packageDir = join(ROOT_DIR, 'packages', packageName); |
| 88 | |
| 89 | log(`Testing npm pack for ${packageName}...`); |
| 90 | |
| 91 | const result = spawnSync('npm', ['pack', '--dry-run'], { |
| 92 | cwd: packageDir, |
| 93 | encoding: 'utf8', |
| 94 | stdio: 'pipe', |
| 95 | shell: true, |
| 96 | }); |
| 97 | |
| 98 | if (result.status !== 0) { |
| 99 | error(`npm pack failed for ${packageName}`); |
| 100 | error(result.stderr); |
| 101 | return false; |
| 102 | } |
| 103 | |
| 104 | log(` npm pack OK for ${packageName}`); |
| 105 | return true; |
| 106 | } |
| 107 | |
| 108 | /** |
| 109 | * Test that a package doesn't have browser-incompatible code |