How to use the yeoman-generator.test.mockPrompt function in yeoman-generator

To help you get started, we’ve selected a few yeoman-generator 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 sethvincent / generator-crtrdg / test / test-creation.js View on Github external
it('creates expected files', function (done) {
    var expected = [
      // add files you expect to exist here.
      '.jshintrc',
      '.editorconfig'
    ]

    helpers.mockPrompt(this.app, {
      'someOption': 'Y'
    })
    this.app.options['skip-install'] = true
    this.app.run({}, function () {
      helpers.assertFiles(expected)
      done()
    })
  })
})
github azzamallow / generator-angulator / test / test-creation.js View on Github external
it('creates expected files', function (done) {
        var expected = [
            // add files you expect to exist here.
            '.jshintrc',
            '.editorconfig'
        ];

        helpers.mockPrompt(this.app, {
            'someOption': true
        });
        this.app.options['skip-install'] = true;
        this.app.run({}, function () {
            helpers.assertFiles(expected);
            done();
        });
    });
});
github yeoman / generator-generator / app / templates / test-creation.js View on Github external
it('creates expected files', function (done) {
    var expected = [
      // add files you expect to exist here.
      '.jshintrc',
      '.editorconfig'
    ];

    helpers.mockPrompt(this.app, {
      'someOption': true
    });
    this.app.options['skip-install'] = true;
    this.app.run({}, function () {
      helpers.assertFile(expected);
      done();
    });
  });
});
github rhumaric / generator-playground / test / test-creation.js View on Github external
helpers.testDirectory(workspace, function (err) {

    if (err) {
      return done(err);
    }

    this.app = helpers.createGenerator('playground:app', [
      path.resolve(__dirname, '../app')
    ]);

    helpers.mockPrompt(this.app, promptAnswers);

    this.app.options['skip-install'] = true;

    console.log('Default run');
    this.app.run({}, function () {
      done();
    });

  }.bind(context));
}
github yeoman / generator-commonjs / test / test-creation.js View on Github external
it('creates expected files', function (done) {
    var expected = [
      '.jshintrc',
      '.editorconfig',
      'package.json'
    ];

    helpers.mockPrompt(this.app, {
      'name': 'mymodule',
      'description': 'awesome module',
      'version': '1.0.0',
      'repository': 'http://github.com',
      'bugs': 'http://jira.com',
      'license': 'MIT',
      'github_username': 'octocat',
      'author_name': 'Octo Cat',
      'author_email': 'octo@example.com',
      'author_url': 'example.com',
      'node_version': '0.10.6',
      'npm_test': 'grunt nodeunit'
    });

    this.app.run(function () {
      helpers.assertFile(expected);
github dustinspecker / generator-ng-poly / test / test-creation.js View on Github external
beforeEach(function (done) {
        this.app = helpers.createGenerator('ng-poly:' + genName, deps, genName + '-test');
        if (mockPrompts) {
          helpers.mockPrompt(this.app, mockPrompts);
        }
        done();
      });
github lpaulger / generator-ng-cordova / test / test-creation.js View on Github external
'www/index.html',
      'www/views/main.html',
      'www/scripts/controllers/MainCtrl.js',
      'www/scripts/init.js',
      'www/scripts/app.js',
      'www/styles/main.scss',
      '.bowerrc',
      '.editorconfig',
      '.jshintrc',
      'bower.json',
      'config.xml',
      'Gruntfile.js',
      'package.json'
    ];

    helpers.mockPrompt(this.app, {
      appName: ['testApp'],
      coffee: [false],
      compass: [true],
      platforms: [],
      plugins: [],
      modules: []
    });

    this.app.run({}, function () {
      helpers.assertFile(expected);
      done();
    });
  });
});
github mazerte / generator-footguard / footguard-base.js View on Github external
Generator.prototype.createModel = function createModel(name, folder, test) {
  name = name || this.name;
  folder = folder || this.folder;
  test = test || this.test;

  if( this.model ) {
    var mg = helpers.createGenerator(
      'footguard:model',
      [__dirname + '/model'],
      [name, folder]
    );
    helpers.mockPrompt(mg, {
      test: test ? 'y' : 'n'
    });
    mg.run();
  }
};