How to use the yeoman-test.createDummyGenerator 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 DefinitelyTyped / DefinitelyTyped / types / yeoman-test / yeoman-test-tests.ts View on Github external
// helpers.testDirectory()
helpers.testDirectory(path.join(__dirname, './temp'), () => {
	fs.writeFileSync('testfile', 'Roses are red.');
});

// helpers.mockPrompt()
helpers.mockPrompt(generator, {foo: 'bar'});

// helpers.restorePrompt()
helpers.restorePrompt(generator);

// helpers.mockLocalConfig()
helpers.mockLocalConfig(generator, {foo: 'bar'});

// helpers.createDummyGenerator()
const dummyGenerator = helpers.createDummyGenerator();

// helpers.createGenerator()
const angularGenerator = helpers.createGenerator('angular:app', [
	'../../app',
	'../../common',
	'../../controller',
	'../../main',
	[helpers.createDummyGenerator(), 'testacular:app']
]);

// helpers.registerDependencies()
helpers.registerDependencies(env, ['dependency']);

// helpers.run()
helpers.run(path.join(__dirname, '../app'))
	.withOptions({foo: 'bar'})
github jhipster / generator-jhipster / test / utils.spec.js View on Github external
packageFolder: 'com/mycompany/myapp',
                    authenticationType: 'jwt',
                    cacheProvider: 'ehcache',
                    websocket: false,
                    databaseType: 'sql',
                    devDatabaseType: 'h2Disk',
                    prodDatabaseType: 'mysql',
                    searchEngine: false,
                    buildTool: 'maven',
                    enableTranslation: true,
                    nativeLanguage: 'en',
                    languages: ['en', 'fr'],
                    testFrameworks: ['gatling', 'protractor'],
                    jhiPrefix: 'jhi'
                };
                const loadedConfig = utils.getAllJhipsterConfig(helpers.createDummyGenerator(), true, configRootDir);
                assert.objectContent(loadedConfig, expectedConfig);
            });
            it('correctly handles deprecated blueprint information', () => {
github mauriciopoppe / generator-mnm / test / helpers / set-up-mockery.js View on Github external
before(function () {
    mockery.enable({
      warnOnUnregistered: false
    })

    mockery.registerMock('npm-name', function (name, cb) {
      cb(null, true)
    })

    mockery.registerMock('github-username', function (name, cb) {
      cb(null, 'unicornUser')
    })

    mockery.registerMock(
      require.resolve('generator-license/app'),
      helpers.createDummyGenerator()
    )

    mockery.registerMock('deps-object', function (deps) {
      var obj = deps.reduce(function (o, v) {
        var tok = v.split('@')
        if (tok.length === 1) tok.push('*')
        o[tok[0]] = tok[1]
        return o
      }, {})
      return Promise.resolve(obj)
    })
  })
github nodecg / generator-nodecg / test / app.js View on Github external
warnOnUnregistered: false
		});

		mockery.registerMock('npm-name', () => {
			return new Promise(resolve => {
				resolve(true);
			});
		});

		mockery.registerMock('github-username', () => {
			return Promise.resolve('unicornUser');
		});

		mockery.registerMock(
			require.resolve('generator-license'),
			helpers.createDummyGenerator()
		);
	});
github electrodejs / deprecated-generator-electrode / test / app.js View on Github external
mockery.enable({
      warnOnReplace: false,
      warnOnUnregistered: false
    });

    mockery.registerMock('npm-name', function () {
      return Promise.resolve(true);
    });

    mockery.registerMock('github-username', function (name, cb) {
      cb(null, 'unicornUser');
    });

    mockery.registerMock(
      require.resolve('generator-license/app'),
      helpers.createDummyGenerator()
    );
  });
github Cognizant-CDE-Australia / generator-confit / test / spec / unit / appGenerator.spec.js View on Github external
beforeTestCb,
    assertionCb
  ).withGenerators([
    [helpers.createDummyGenerator(), 'confit:buildBrowser'],
    [helpers.createDummyGenerator(), 'confit:buildAssets'],
    [helpers.createDummyGenerator(), 'confit:buildCSS'],
    [helpers.createDummyGenerator(), 'confit:buildHTML'],
    [helpers.createDummyGenerator(), 'confit:buildJS'],
    [helpers.createDummyGenerator(), 'confit:documentation'],
    [helpers.createDummyGenerator(), 'confit:entryPoint'],
    [helpers.createDummyGenerator(), 'confit:paths'],
    [helpers.createDummyGenerator(), 'confit:release'],
    [helpers.createDummyGenerator(), 'confit:sampleApp'],
    [helpers.createDummyGenerator(), 'confit:serverDev'],
    [helpers.createDummyGenerator(), 'confit:serverProd'],
    [helpers.createDummyGenerator(), 'confit:testSystem'],
    [helpers.createDummyGenerator(), 'confit:testVisualRegression'],
    [helpers.createDummyGenerator(), 'confit:testUnit'],
    [helpers.createDummyGenerator(), 'confit:verify'],
    [helpers.createDummyGenerator(), 'confit:zzfinish'],
  ]);
}
github rakuten-frontend / generator-rff / test / test-creation.js View on Github external
function runWithPrompts(prompts, callback) {
  helpers.run(path.join(__dirname, '../generators/app'))
    .inDir(path.join(__dirname, 'temp'))
    .withGenerators([
      [helpers.createDummyGenerator(), 'mocha:app'],
      [helpers.createDummyGenerator(), 'jasmine:app']
    ])
    .withPrompts(prompts)
    .on('end', callback);
}