How to use the yeoman-test.createGenerator 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 10up / generator-wp-make / test / lib / base.js View on Github external
it( 'registers methods with the run loop', function () {
			// Create a dummy instance with the Yeoman helper.
			const app = helpers.createGenerator(
				'dummy:app',
				[[MakeBase, 'dummy:app']]
			);
			// The queue annoying and not well mockable.
			// So instead we'll just dig into the object and check it...
			const queues = app.env.runLoop.__queues__;
			const initQueue = queues.initializing.__queue__;
			const promptQueue = queues.prompting.__queue__;
			const configQueue = queues.configuring.__queue__;
			const writeQueue = queues.writing.__queue__;
			const endQueue = queues.end.__queue__;
			// Check to make sure the once flags are in the queues.
			// Does a deccent job of ensuring the function is actually
			// registered with the environments run loop. Not perfect, but
			// better than nothing.
			assert.includeMembers(
github sincraianul / generator-angular-material-fullstack / test / test-file-creation.js View on Github external
it('should use existing config if available', function(done) {
        this.timeout(60000);
        fs.copySync(__dirname + '/fixtures/.yo-rc.json', __dirname + '/temp/.yo-rc.json');
        var gen = helpers.createGenerator('angular-material-fullstack:app', [
          '../../app',
          [
            helpers.createDummyGenerator(),
            'ng-component:app'
          ]
        ]);
        gen.options['skip-install'] = true;
        helpers.mockPrompt(gen, {
          skipConfig: true
        });
        gen.run({}, function () {
          done();
        });
      });
github eugeneware / generator-nodejs / test / test-creation.js View on Github external
helpers.testDirectory(tempPath, function (err) {
      if (err) {
        return done(err);
      }

      this.app = helpers.createGenerator('nodejs:app', [
        '../app'
      ], [], { 'skip-install': true });
      done();
    }.bind(this));
  });
github krakenjs / generator-kraken / test / util / run.js View on Github external
helpers.testDirectory(dir, function (err) {
        if (err) {
            return done(err);
        }

        var app = helpers.createGenerator(config.type, config.dependencies, config.args, config.options);
        helpers.mockPrompt(app, config.prompt);

        app.run(function () {
            done(null, app);
        });
    });
};
github eslint / generator-eslint / tests / plugin / index.js View on Github external
helpers.testDirectory(testDirectory, function(err) {
            if (err) {
                return done(err);
            }

            this.rule = helpers.createGenerator("eslint:plugin", [
                "../plugin"
            ]);
            return done();
        }.bind(this));
    });
github sincraianul / generator-angular-material-fullstack / test / test-file-creation.js View on Github external
gen.run({}, function () {
      var afGenerator;
      var deps = [path.join('../..', generatorType)];
      afGenerator = helpers.createGenerator('angular-material-fullstack:' + generatorType, deps, [name]);

      helpers.mockPrompt(afGenerator, mockPrompt);
      afGenerator.run([], function () {
        callback();
      });
    });
  }
github angular-fullstack / generator-angular-fullstack / Gruntfile.js View on Github external
mongoose: true,
        testing: 'jasmine',
        auth: true,
        oauth: ['googleAuth', 'twitterAuth'],
        ws: true
      };

      var deps = [
        '../app',
        [
          helpers.createDummyGenerator(),
          'ng-component:app'
        ]
      ];

      var gen = helpers.createGenerator('angular-fullstack:app', deps);

      helpers.mockPrompt(gen, options);
      gen.run({}, function () {
        deferred.resolve();
      });

      return deferred.promise;
    }
  });
github sincraianul / generator-angular-material-fullstack / Gruntfile.js View on Github external
material: true,
        mongoose: true,
        auth: true,
        oauth: ['googleAuth', 'twitterAuth'],
        socketio: true
      };

      var deps = [
        '../app',
        [
          helpers.createDummyGenerator(),
          'ng-component:app'
        ]
      ];

      var gen = helpers.createGenerator('angular-material-fullstack:app', deps);

      helpers.mockPrompt(gen, options);
      gen.run({}, function () {
        deferred.resolve();
      });

      return deferred.promise;
    }