()
| 8 | import { checkSnapshots } from './check-snapshots'; |
| 9 | |
| 10 | export async function run() { |
| 11 | const config: Config = configure(process.argv); |
| 12 | |
| 13 | try { |
| 14 | await buildSandboxes(config.sourceRoots, config.chunk, config.verifySandboxes || config.checkVisualRegressions, config.definedSandboxesPath); |
| 15 | } catch (err) { |
| 16 | throw err; |
| 17 | } |
| 18 | |
| 19 | if (config.build || config.buildWithServiceWorker) { |
| 20 | return await buildAngularCli(config.angularAppName, !!config.buildWithServiceWorker, config.baseHref, config.angularCliMaxBuffer); |
| 21 | } |
| 22 | |
| 23 | if (config.verifySandboxes || (config.checkVisualRegressions && !config.deleteSnapshots)) { |
| 24 | config.angularCliPort = await getPort({host: config.angularCliHost}); |
| 25 | } |
| 26 | |
| 27 | if ((config.watch && !config.deleteSnapshots) || config.verifySandboxes || (config.checkVisualRegressions && !config.deleteSnapshots)) { |
| 28 | startWatch(config.sourceRoots, () => |
| 29 | buildSandboxes(config.sourceRoots, config.chunk, config.verifySandboxes || config.checkVisualRegressions, config.definedSandboxesPath)); |
| 30 | } |
| 31 | |
| 32 | if ((config.serve && !config.deleteSnapshots) || config.verifySandboxes || (config.checkVisualRegressions && !config.deleteSnapshots)) { |
| 33 | try { |
| 34 | await serveAngularCli(config); |
| 35 | } catch (err) { |
| 36 | throw err; |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | if (config.verifySandboxes) { |
| 41 | try { |
| 42 | await verifySandboxes(config); |
| 43 | } catch (err) { |
| 44 | throw err; |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | if (config.checkVisualRegressions) { |
| 49 | try { |
| 50 | await checkSnapshots(config); |
| 51 | } catch (err) { |
| 52 | throw err; |
| 53 | } |
| 54 | } |
| 55 | } |
no test coverage detected