Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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()
})
})
})
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();
});
});
});
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();
});
});
});
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));
}
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);
beforeEach(function (done) {
this.app = helpers.createGenerator('ng-poly:' + genName, deps, genName + '-test');
if (mockPrompts) {
helpers.mockPrompt(this.app, mockPrompts);
}
done();
});
'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();
});
});
});
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();
}
};