MCPcopy Index your code
hub / github.com/angular-fullstack/generator-angular-fullstack / runGen

Function runGen

src/test/test-helpers.js:91–123  ·  view source on GitHub ↗
(prompts, opts={})

Source from the content-addressed store, hash-verified

89 * @returns {Promise}
90 */
91export function runGen(prompts, opts={}) {
92 let options = opts.options || {skipInstall: true};
93
94 // let dir;
95 let gen = helpers
96 .run(require.resolve('../generators/app'))
97 .inTmpDir(function(dir) {
98 // this will create a new temporary directory for each new generator run
99 var done = this.async();
100 if(DEBUG) console.log(`TEMP DIR: ${dir}`);
101
102 let promises = [
103 fs.symlinkAsync(__dirname + '/fixtures/node_modules', dir + '/node_modules')
104 ];
105
106 if(opts.copyConfigFile) {
107 promises.push(copyAsync(path.join(TEST_DIR, 'fixtures/.yo-rc.json'), path.join(dir, '.yo-rc.json')));
108 }
109
110 // symlink our dependency directories
111 return Promise.all(promises).then(done);
112 })
113 .withGenerators([
114 require.resolve('../generators/endpoint'),
115 // [helpers.createDummyGenerator(), 'ng-component:app']
116 ])
117 // .withArguments(['upperCaseBug'])
118 .withOptions(options);
119
120 if(prompts) gen.withPrompts(prompts);
121
122 return gen.toPromise();
123}

Callers 2

main.test.jsFile · 0.90
endpoint.test.jsFile · 0.90

Calls 1

copyAsyncFunction · 0.85

Tested by

no test coverage detected