hunk.code_window:   });
   }, Promise.resolve())
   .then(
     () => console.log(green('Done.')),
     (err) => {
       console.log('\n');
       console.error(red(`Test "${currentFileName}" failed...`));
       console.error(red(err.message));
  
hunk.labels: keep keep keep replace keep keep keep keep
hunk.after_edit:   () => {
       console.log(green('Done.'));
       process.exit(0);
     },
  
hunk.file_path: tests/e2e_runner.js
hunk.type: replace
file: import {readdirSync} from 'fs';
  import {oneLine} from 'common-tags';
  
  import {ng} from '../../utils/process';
  import {addImportToModule} from '../../utils/ast';
  
  
  export default function(argv: any) {
    /** This test is disabled when not on nightly. */
    if (!argv.nightly) {
      return Promise.resolve();
    }
  
    let oldNumberOfFiles = 0;
    let currentNumberOfDistFiles = 0;
  
    return Promise.resolve()
      .then(() => ng('build'))
      .then(() => oldNumberOfFiles = readdirSync('dist').length)
      .then(() => ng('generate', 'module', 'lazy'))
      .then(() => addImportToModule('src/app/app.module.ts', oneLine`
        RouterModule.forRoot([{ path: "/lazy", loadChildren: "./lazy/lazy.module#LazyModule" }])
        `, '@angular/router'))
      .then(() => ng('build'))
      .then(() => currentNumberOfDistFiles = readdirSync('dist').length)
      .then(() => {
        if (oldNumberOfFiles >= currentNumberOfDistFiles) {
          throw new Error('A bundle for the lazy module was not created.');
        }
      });
  }
  