| 41 | }; |
| 42 | |
| 43 | const run = async ({cwd}) => { |
| 44 | await logPromise( |
| 45 | exec('node build-all.js', {cwd: join(cwd, 'fixtures/packaging')}), |
| 46 | 'Generating "packaging" fixture', |
| 47 | 20000 // This takes roughly 20 seconds |
| 48 | ); |
| 49 | |
| 50 | let errorMessage; |
| 51 | let response; |
| 52 | |
| 53 | try { |
| 54 | response = server.start({ |
| 55 | port: 9000, |
| 56 | directory: cwd, |
| 57 | }); |
| 58 | |
| 59 | errorMessage = await logPromise( |
| 60 | validate(), |
| 61 | 'Verifying "packaging" fixture' |
| 62 | ); |
| 63 | } finally { |
| 64 | response.close(); |
| 65 | } |
| 66 | |
| 67 | if (errorMessage) { |
| 68 | console.error( |
| 69 | theme.error('✗'), |
| 70 | 'Verifying "packaging" fixture\n ', |
| 71 | theme.error(errorMessage) |
| 72 | ); |
| 73 | process.exit(1); |
| 74 | } |
| 75 | }; |
| 76 | |
| 77 | module.exports = run; |