Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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()
before(function(done) {
stub = sinon.stub(existTest, 'verifyPath', function() {
return true;
});
helpers.run(path.join(__dirname, '../generators/router'))
.inDir(path.join(os.tmpdir(), './temp_test'))
.withArguments(['some_feature'])
.withOptions({
directory: 'some_feature',
controller: 'some_controller'
})
.on('end', done);
});
it('creates files', function() {
before(function (done) {
helpers.run(path.join(__dirname, '../app'))
.withOptions({ skipInstall: true })
.withPrompts({ someOption: true })
.on('end', done);
});
beforeEach(function () {
app = helpers.run(path.join(__dirname, '../app'))
.inDir(path.join(__dirname, './tmp'))
.withOptions({ 'skip-install': true, 'skip-welcome-message': true })
.withGenerators(deps);
});
beforeEach(function (done) {
gen = helpers.run(path.join( __dirname, '../app'))
.inDir(path.join( __dirname, 'temp/advanced-default'))
.withOptions({'skip-install' : true})
.withArguments([])
.withPrompt({
'mode': 'Advanced',
'name' : "MyApp",
'angular_version' : '2.0.0',
'version' : '0.0.1',
'description' : 'A Great App',
'csslint' : false,
'complexity' : false,
'test' : false,
'revision' : false,
'gitignore' : false,
'i18n' : false,
'csspreprocessor' : 'none',
before(function (done) {
helpers.run(path.join(__dirname, '../generators/blueprint'))
.withArguments(['style'])
.withOptions({ 'skip-install': true })
.on('end', done);
});
before((done) => {
helpers.run(path.join(__dirname, '../generators/app'))
.withOptions({skipInstall: true})
.on('end', done);
});
before(function(done) {
stub = sinon.stub(existTest, 'verifyPath', function() {
return true;
});
helpers.run(path.join(__dirname, '../generators/compositeview'))
.withArguments(['apples'])
.inTmpDir(function(dir) {
var done = this.async();
var filePath = path.join(dir, 'app/scripts/apps/template', 'feature_template.hbs');
fs.ensureFile(filePath, done);
})
.withOptions({
directory: 'fruit',
itemview: 'apple',
template: 'template/feature_template.hbs'
})
.withLocalConfig({ preferences: {ecma: 6 }})
.on('end', done);
});
before(function (done) {
this.timeout(240000);
var dir;
helpers.run(path.join(__dirname, '../app'))
.inDir(path.join(__dirname, './mock'), function (d) {
dir = d;
var cb = this.async();
exec('cp ' + path.join(__dirname, '/files/.yo-rc.json') + ' ' + dir, function () {
cb();
});
})
.withPrompt({
name: 'Test',
backend: 'mongo',
modules: [],
sockets: true,
auth: true,
tests: ['e2e', 'karma', 'mocha', 'control']
})
.on('end', function () {
beforeEach(function (done) {
gen = helpers.run(path.join( __dirname, '../app'))
.inDir(path.join( __dirname, 'temp/advanced-custom-third-module'))
.withOptions({'skip-install' : true})
.withArguments([])
.withPrompt({
'mode': 'Advanced',
'name' : "MyApp",
'angular_version' : '2.0.0',
'version' : '0.0.1',
'description' : 'A Great App',
'csslint' : true,
'complexity' : true,
'test' : false,
'revision' : true,
'gitignore' : true,
'i18n' : true,
'csspreprocessor' : 'less',