Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('create with invalid version', function () {
return helpers.run(path.join(__dirname, '../generators/model'))
.cd(osTempDir)
.withOptions({
'model-name': 'invalidVersionModel',
'model-version': 'asd',
})
.toPromise()
.then(dir => {
// console.log(fs.readdirSync(path.join(osTempDir, 'repo-amp/src/main/amp/config/alfresco/module/repo-amp/model/generated')));
assert.noFile([
'repo-amp/src/main/amp/config/alfresco/module/repo-amp/model/generated/invalidVersionModel.xml',
'repo-amp/src/main/amp/config/alfresco/module/repo-amp/context/generated/invalidversion-model-context.xml',
'repo-amp/src/main/amp/config/alfresco/module/repo-amp/messages/generated/invalidVersionModel.properties',
].map(relativePath => path.join(osTempDir, relativePath)));
});
});
async function createAppProject(appName) {
// The root directory of the application project
// loopback-next/sandbox/
const sandbox = path.join(rootDir, 'sandbox', appName);
const pkgName = `@loopback/${appName}`;
const props = {
name: pkgName,
description: 'My sandbox app for LoopBack 4',
outdir: sandbox,
};
await helpers
.run(appGenerator)
.inDir(sandbox)
// Mark it private to prevent accidental npm publication
.withOptions({private: true})
.withPrompts(props);
process.chdir(rootDir);
await lernaBootstrap(pkgName);
return sandbox;
}
this.install(version, function () {
// execute generator
var generatorBase = path.resolve('node_modules/generator-m-ionic');
var generatorGenerators = path.join(generatorBase, 'generators');
console.log(chalk.green('running: ') + require(path.join(generatorBase, '/package.json')).version);
var ctx = yeomanTest.run(path.join(generatorGenerators, '/app'));
ctx.settings.tmpdir = false; // don't run in tempdir
ctx
.withGenerators(this.getDirectoryDirs(generatorGenerators))
.withOptions({ // execute with options
'skip-install': true, // don't need to install deps
'skip-sdk': true, // for some reason won't install cordova properly, so just leave it
'force': true
})
.withPrompts(answers) // answer prompts
.on('end', function () {
// uninstall
this.uninstall(version, cb);
}.bind(this));
}.bind(this));
},
before(done => {
helpers
.run(require.resolve('../generators/docker-compose'))
.inTmpDir(dir => {
fse.copySync(path.join(__dirname, './templates/compose/'), dir);
})
.withOptions({ skipChecks: true })
.withPrompts({
deploymentApplicationType: 'microservice',
directoryPath: './',
chosenApps: ['01-gateway', '02-mysql'],
clusteredDbApps: [],
monitoring: 'elk'
})
.on('end', done);
});
it('creates expected default files', () => {
beforeEach(function (done) {
helpers.run(path.join(__dirname, '../generators/app'))
.inDir(path.join(__dirname, 'tmp'))
.withOptions({
'skip-install': true,
'skip-welcome-message': true
})
.withPrompts(answers)
.on('end', done);
});
beforeAll(() => {
return helpers
.run(path.join(__dirname, '../generators/app'))
.withPrompts({
projectName: 'name',
githubUrl: 'url',
githubUsername: 'username',
projectDescription: 'description',
html: 'pug',
css: 'sass',
es: true,
sw: true,
travis: false,
deploy: 'firebase'
})
.toPromise();
});
test.before(() => {
return helpers.run(path.join(__dirname, '../../generators/gulp'))
.withOptions({uploading: 'Rsync'})
.toPromise();
});
before(function () {
return helpers.run(path.join(__dirname, '../generators/jsrootobject'))
.cd(osTempDir)
.withOptions({
'root': 'CamelRoot',
'package': 'org.alfresco.jsroot',
})
.toPromise();
});
before(function () {
return helpers.run(path.join(__dirname, '../generators/app'))
.inDir(osTempDir)
.withOptions({ 'skip-install': true })
.withPrompts({
sdkVersion: '2.1.1',
projectArtifactId: 'temp-test',
removeDefaultSourceAmps: false,
removeDefaultSourceSamples: false,
})
.toPromise();
});