How to use the yeoman-test.testDirectory 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
import * as path from 'path';
import * as helpers from 'yeoman-test';
import Generator = require('yeoman-generator');

declare const env: any;
declare const generator: Generator;
declare function before(done: (...args: any[]) => void): void;

// helpers.setUpTestDirectory()
before(helpers.setUpTestDirectory('dir'));

// helpers.gruntfile()
before(done => helpers.gruntfile({foo: 'bar'}, done));

// 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()
github hemanth / generator-pwa / test / app.js View on Github external
test.beforeEach(async () => {

  await pify(helpers.testDirectory)(path.join(__dirname, 'temp'));
  generator = helpers.createGenerator('pwa', ['../../generators/app/'], null, {skipInstall: true});
});
github angular-fullstack / generator-angular-fullstack / test / test-file-creation.js View on Github external
beforeEach(function (done) {
    this.timeout(10000);
    var deps = [
      '../../generators/app',
      '../../generators/endpoint',
      [
        helpers.createDummyGenerator(),
        'ng-component:app'
      ]
    ];

    helpers.testDirectory(path.join(__dirname, 'temp'), function (err) {
      if (err) {
        return done(err);
      }

      gen = helpers.createGenerator('angular-fullstack:app', deps, [], {
        skipInstall: true
      });
      gen.conflicter.force = true;
      done();
    }.bind(this));
  });
github eslint / generator-eslint / tests / rule / index.js View on Github external
beforeEach(function(done) {
        helpers.testDirectory(testDirectory, function(err) {
            if (err) {
                return done(err);
            }

            this.rule = helpers.createGenerator("eslint:rule", [
                "../rule"
            ]);
            return done();
        }.bind(this));
    });
github eslint / generator-eslint / tests / plugin / index.js View on Github external
beforeEach(function(done) {
        helpers.testDirectory(testDirectory, function(err) {
            if (err) {
                return done(err);
            }

            this.rule = helpers.createGenerator("eslint:plugin", [
                "../plugin"
            ]);
            return done();
        }.bind(this));
    });
github eugeneware / generator-nodejs / test / test-creation.js View on Github external
beforeEach(function (done) {
    helpers.testDirectory(tempPath, function (err) {
      if (err) {
        return done(err);
      }

      this.app = helpers.createGenerator('nodejs:app', [
        '../app'
      ], [], { 'skip-install': true });
      done();
    }.bind(this));
  });
github eslint / generator-eslint / tests / app / index.js View on Github external
before(function(done) {
        this.spy = sandbox.spy();

        this.dummyGenerator = generators.Base.extend({
            exec: this.spy
        });

        helpers.testDirectory(path.join(__dirname, "../../temp"), done);
    });
github krakenjs / generator-kraken / test / util / run.js View on Github external
module.exports = function run(config, done) {
    var dir = path.join(__dirname, '..', '..', 'tmp');

    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 FountainJS / fountain / test / old / helper.js View on Github external
exports.run = function run(prompts, callback) {
  const fountain = helpers.createGenerator('fountain-webapp:app', [generatorPath], null);

  helpers.mockPrompt(fountain, prompts);

  helpers.testDirectory(workPath, () => {
    fountain.run(() => {
      const test = spawn('gulp', ['test'], {stdio: 'inherit'});
      test.on('exit', callback);
    });
  });
};
github sincraianul / generator-angular-material-fullstack / test / test-file-creation.js View on Github external
beforeEach(function (done) {
    this.timeout(10000);
    var deps = [
      '../../app',
      [
        helpers.createDummyGenerator(),
        'ng-component:app'
      ]
    ];

    helpers.testDirectory(path.join(__dirname, 'temp'), function (err) {
      if (err) {
        return done(err);
      }

      gen = helpers.createGenerator('angular-material-fullstack:app', deps);
      gen.options['skip-install'] = true;
      done();
    }.bind(this));
  });