How to use the yeoman-test.run function in yeoman-test

To help you get started, we’ve selected a few yeoman-test examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github binduwavell / generator-alfresco / test / test-model-2-1-1.js View on Github external
it('create with invalid version', function () {
    return helpers.run(path.join(__dirname, '../generators/model'))
      .cd(osTempDir)
      .withOptions({
        'model-name': 'invalidVersionModel',
        'model-version': 'asd',
      })
      .toPromise()
      .then(dir => {
        // console.log(fs.readdirSync(path.join(osTempDir, 'repo-amp/src/main/amp/config/alfresco/module/repo-amp/model/generated')));
        assert.noFile([
          'repo-amp/src/main/amp/config/alfresco/module/repo-amp/model/generated/invalidVersionModel.xml',
          'repo-amp/src/main/amp/config/alfresco/module/repo-amp/context/generated/invalidversion-model-context.xml',
          'repo-amp/src/main/amp/config/alfresco/module/repo-amp/messages/generated/invalidVersionModel.properties',
        ].map(relativePath => path.join(osTempDir, relativePath)));
      });
  });
github strongloop / loopback-next / packages / cli / smoke-test / openapi / code-gen-utils.js View on Github external
async function createAppProject(appName) {
  // The root directory of the application project
  // loopback-next/sandbox/
  const sandbox = path.join(rootDir, 'sandbox', appName);
  const pkgName = `@loopback/${appName}`;
  const props = {
    name: pkgName,
    description: 'My sandbox app for LoopBack 4',
    outdir: sandbox,
  };

  await helpers
    .run(appGenerator)
    .inDir(sandbox)
    // Mark it private to prevent accidental npm publication
    .withOptions({private: true})
    .withPrompts(props);

  process.chdir(rootDir);
  await lernaBootstrap(pkgName);

  return sandbox;
}
github mwaylabs / generator-m-ionic / generators / app / templates / gulp / update.js View on Github external
this.install(version, function () {
      // execute generator
      var generatorBase = path.resolve('node_modules/generator-m-ionic');
      var generatorGenerators = path.join(generatorBase, 'generators');
      console.log(chalk.green('running: ') + require(path.join(generatorBase, '/package.json')).version);

      var ctx = yeomanTest.run(path.join(generatorGenerators, '/app'));
      ctx.settings.tmpdir = false; // don't run in tempdir
      ctx
      .withGenerators(this.getDirectoryDirs(generatorGenerators))
      .withOptions({ // execute with options
        'skip-install': true, // don't need to install deps
        'skip-sdk': true, // for some reason won't install cordova properly, so just leave it
        'force': true
      })
      .withPrompts(answers) // answer prompts
      .on('end', function () {
        // uninstall
        this.uninstall(version, cb);
      }.bind(this));
    }.bind(this));
  },
github jhipster / generator-jhipster / test / docker-compose.spec.js View on Github external
before(done => {
            helpers
                .run(require.resolve('../generators/docker-compose'))
                .inTmpDir(dir => {
                    fse.copySync(path.join(__dirname, './templates/compose/'), dir);
                })
                .withOptions({ skipChecks: true })
                .withPrompts({
                    deploymentApplicationType: 'microservice',
                    directoryPath: './',
                    chosenApps: ['01-gateway', '02-mysql'],
                    clusteredDbApps: [],
                    monitoring: 'elk'
                })
                .on('end', done);
        });
        it('creates expected default files', () => {
github Veams / generator-veams / test / grunt-webdriver-spec.js View on Github external
beforeEach(function (done) {
		helpers.run(path.join(__dirname, '../generators/app'))
			.inDir(path.join(__dirname, 'tmp'))
			.withOptions({
				'skip-install': true,
				'skip-welcome-message': true
			})
			.withPrompts(answers)
			.on('end', done);
	});
github nirgn975 / generator-jekyll-starter-kit / __tests__ / app.js View on Github external
beforeAll(() => {
    return helpers
      .run(path.join(__dirname, '../generators/app'))
      .withPrompts({
        projectName: 'name',
        githubUrl: 'url',
        githubUsername: 'username',
        projectDescription: 'description',
        html: 'pug',
        css: 'sass',
        es: true,
        sw: true,
        travis: false,
        deploy: 'firebase'
      })
      .toPromise();
  });
github sondr3 / generator-jekyllized / test / uploading / rsync.js View on Github external
test.before(() => {
  return helpers.run(path.join(__dirname, '../../generators/gulp'))
    .withOptions({uploading: 'Rsync'})
    .toPromise();
});
github binduwavell / generator-alfresco / test / test-root-object-2-1-1.js View on Github external
before(function () {
        return helpers.run(path.join(__dirname, '../generators/jsrootobject'))
          .cd(osTempDir)
          .withOptions({
            'root': 'CamelRoot',
            'package': 'org.alfresco.jsroot',
          })
          .toPromise();
      });
github binduwavell / generator-alfresco / test / test-model-2-1-1.js View on Github external
before(function () {
    return helpers.run(path.join(__dirname, '../generators/app'))
      .inDir(osTempDir)
      .withOptions({ 'skip-install': true })
      .withPrompts({
        sdkVersion: '2.1.1',
        projectArtifactId: 'temp-test',
        removeDefaultSourceAmps: false,
        removeDefaultSourceSamples: false,
      })
      .toPromise();
  });