Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it( 'registers methods with the run loop', function () {
// Create a dummy instance with the Yeoman helper.
const app = helpers.createGenerator(
'dummy:app',
[[MakeBase, 'dummy:app']]
);
// The queue annoying and not well mockable.
// So instead we'll just dig into the object and check it...
const queues = app.env.runLoop.__queues__;
const initQueue = queues.initializing.__queue__;
const promptQueue = queues.prompting.__queue__;
const configQueue = queues.configuring.__queue__;
const writeQueue = queues.writing.__queue__;
const endQueue = queues.end.__queue__;
// Check to make sure the once flags are in the queues.
// Does a deccent job of ensuring the function is actually
// registered with the environments run loop. Not perfect, but
// better than nothing.
assert.includeMembers(
it('should use existing config if available', function(done) {
this.timeout(60000);
fs.copySync(__dirname + '/fixtures/.yo-rc.json', __dirname + '/temp/.yo-rc.json');
var gen = helpers.createGenerator('angular-material-fullstack:app', [
'../../app',
[
helpers.createDummyGenerator(),
'ng-component:app'
]
]);
gen.options['skip-install'] = true;
helpers.mockPrompt(gen, {
skipConfig: true
});
gen.run({}, 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));
});
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);
});
});
};
helpers.testDirectory(testDirectory, function(err) {
if (err) {
return done(err);
}
this.rule = helpers.createGenerator("eslint:plugin", [
"../plugin"
]);
return done();
}.bind(this));
});
gen.run({}, function () {
var afGenerator;
var deps = [path.join('../..', generatorType)];
afGenerator = helpers.createGenerator('angular-material-fullstack:' + generatorType, deps, [name]);
helpers.mockPrompt(afGenerator, mockPrompt);
afGenerator.run([], function () {
callback();
});
});
}
mongoose: true,
testing: 'jasmine',
auth: true,
oauth: ['googleAuth', 'twitterAuth'],
ws: true
};
var deps = [
'../app',
[
helpers.createDummyGenerator(),
'ng-component:app'
]
];
var gen = helpers.createGenerator('angular-fullstack:app', deps);
helpers.mockPrompt(gen, options);
gen.run({}, function () {
deferred.resolve();
});
return deferred.promise;
}
});
material: true,
mongoose: true,
auth: true,
oauth: ['googleAuth', 'twitterAuth'],
socketio: true
};
var deps = [
'../app',
[
helpers.createDummyGenerator(),
'ng-component:app'
]
];
var gen = helpers.createGenerator('angular-material-fullstack:app', deps);
helpers.mockPrompt(gen, options);
gen.run({}, function () {
deferred.resolve();
});
return deferred.promise;
}