How to use yeoman-generator - 10 common examples

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 eguneys / generator-emberfs / test / test_route.js View on Github external
.on('end', function() {

                    assert.file([].concat(
                        defaultExpectedFiles,
                        'app/client/scripts/routes/test_deps.js',
                        'app/client/templates/test',
                        'app/client/templates/test/index.hbs'
                    ));

                    assert.fileContent('app/client/scripts/routes/test_route.js', /App.TestRoute = Ember.Route/);
                    assert.fileContent('app/client/scripts/routes/test_route.js', /requireLists: \['routes\/test_deps'\]/);

                    assert.fileContent('app/client/scripts/routes/test_deps.js', /'templates\/test'/);

                    // gulpfile requirejs modules injection
                    assert.fileContent('gulpfile.js',
                                       /gulp.task\('build-requirejs',[\s\S]*modules: \[[\s\S]+?\n? {12}\{[\s\S]+name: 'routes\/test_deps',[\s]+exclude: \['app\/common'][\s]+}[\s]+\]/);
                    
                    done();
github ironSource / node-generator-bare-react / test / util / runner.js View on Github external
function start() {
      const ctx = helpers.run(path)
          , end = (err) => { ctx._run = noop, next(), done(err, ctx) }

      // Shorthands
      if (options) ctx.withOptions(options)
      if (prompts) ctx.withPrompts(prompts)
      if (args) ctx.withArguments(args)
      if (config) ctx.withLocalConfig(config)
      if (generators) ctx.withGenerators(generators)

      ctx.on('end', end).on('error', end)

      // Add error handling to async(): abort on error
      const async = ctx.async.bind(ctx)

      ctx.async = () => {
        let done = async()
github Swiip / generator-gulp-angular / test / test-files-generate.mocha.js View on Github external
gulpAngular.run({}, function() {
        assert.file([].concat(expectedFile, [
          'src/app/index.css',
        ]));

        assert.noFile('src/app/vendor.*');

        // assert.fileContent([].concat(expectedGulpContent, [
        //   ['src/index.html', /<link rel="stylesheet" href="..\/bower_components\/bootstrap\/dist\/css\/bootstrap.css">/],
        //   ['bower.json', /"bootstrap": "3.2.x"/],
        // ]));

        // No Gulp task for style
        assert.fileContent([
          ['src/index.html', /<link rel="stylesheet" href="..\/bower_components\/bootstrap\/dist\/css\/bootstrap.css">/],
          ['bower.json', /"bootstrap": "3.2.x"/],
        ]);

        assert.noFileContent([
          ['package.json', /"gulp-less": "\^1.3.3"/],
          ['package.json', /"gulp-sass": "\^0.7.3"/],
          ['package.json', /"gulp-ruby-sass": "\^0.7.1"/],
github vincentmac / generator-browserify / test / test-creation.js View on Github external
this.app.run({}, function () {
            assert.file(expected);

            // read bower.json
            var bowerJson = fs.readFileSync('bower.json', 'utf8');
            var bowerDeps = JSON.parse(bowerJson).dependencies;

            assert.ok(bowerDeps.foundation);
            assert.ok(bowerDeps.modernizr);

            // read package.json
            var packageJson = fs.readFileSync('package.json', 'utf8');
            var packageDeps = JSON.parse(packageJson).dependencies;
            var packageDevDeps = JSON.parse(packageJson).devDependencies;

            assert.ok(packageDeps.backbone);
            assert.ok(packageDeps.jquery);
            assert.ok(packageDeps.lodash);
            assert.ok(!packageDevDeps.grunt);
            assert.ok(packageDevDeps.gulp);
            assert.ok(packageDevDeps['browserify-jade']);

            done();
        });
github vincentmac / generator-browserify / test / test-creation.js View on Github external
this.app.run({}, function () {
            assert.file(expected);

            // read bower.json Files
            var bowerJson = fs.readFileSync('bower.json', 'utf8');
            var bowerDeps = JSON.parse(bowerJson).dependencies;

            assert.ok(bowerDeps.bootstrap);
            assert.ok(bowerDeps.modernizr);

            // read package.json
            var packageJson = fs.readFileSync('package.json', 'utf8');
            var packageDeps = JSON.parse(packageJson).dependencies;
            var packageDevDeps = JSON.parse(packageJson).devDependencies;

            assert.ok(packageDeps.backbone);
            assert.ok(packageDeps.jquery);
            assert.ok(packageDeps.lodash);
            assert.ok(packageDevDeps.grunt);
            assert.ok(packageDevDeps['browserify-jade']);

            done();
        });
    });
github vincentmac / generator-browserify / test / test-creation.js View on Github external
// read bower.json
            var bowerJson = fs.readFileSync('bower.json', 'utf8');
            var bowerDeps = JSON.parse(bowerJson).dependencies;

            assert.ok(bowerDeps.foundation);
            assert.ok(bowerDeps.modernizr);

            // read package.json
            var packageJson = fs.readFileSync('package.json', 'utf8');
            var packageDeps = JSON.parse(packageJson).dependencies;
            var packageDevDeps = JSON.parse(packageJson).devDependencies;

            assert.ok(packageDeps.backbone);
            assert.ok(packageDeps.jquery);
            assert.ok(packageDeps.lodash);
            assert.ok(!packageDevDeps.grunt);
            assert.ok(packageDevDeps.gulp);
            assert.ok(packageDevDeps['browserify-jade']);

            done();
        });
    });
github vincentmac / generator-browserify / test / test-creation.js View on Github external
this.app.run({}, function () {
            assert.file(expected);

            // read bower.json Files
            var bowerJson = fs.readFileSync('bower.json', 'utf8');
            var bowerDeps = JSON.parse(bowerJson).dependencies;

            assert.ok(bowerDeps.foundation);
            assert.ok(bowerDeps.modernizr);

            // read package.json
            var packageJson = fs.readFileSync('package.json', 'utf8');
            var packageDeps = JSON.parse(packageJson).dependencies;
            var packageDevDeps = JSON.parse(packageJson).devDependencies;

            assert.ok(packageDeps.backbone);
            assert.ok(packageDeps.jquery);
            assert.ok(packageDeps.lodash);
            assert.ok(packageDevDeps.grunt);
            assert.ok(packageDevDeps['browserify-jade']);

            done();
        });
    });