Example #1
0
 it('creates expected files', () => {
     assert.file(expectedFiles.jenkins);
     assert.file(expectedFiles.dockerRegistry);
     assert.noFile(expectedFiles.gitlab);
     assert.noFile(expectedFiles.travis);
     assert.noFile(expectedFiles.circle);
 });
 it('generates expected files', () => {
     assert.file(`${CLIENT_MAIN_SRC_DIR}i18n/en/sampleMicroserviceBar.json`);
     assert.file(expectedFiles.clientNg2GatewayMicroserviceEntity);
     assert.noFile(expectedFiles.gatling);
     assert.fileContent(`${CLIENT_MAIN_SRC_DIR}app/entities/sampleMicroservice/bar/bar.service.ts`, 'samplemicroservice');
     assert.noFile(`${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/web/rest/BarResource.java`);
 });
Example #3
0
 it('creates expected files for default configuration with skip client option enabled', function () {
     assert.file(expectedFiles.server);
     assert.file(expectedFiles.gradle);
     assert.noFile(expectedFiles.client);
     assert.noFile(['gulpfile.js']);
     assert.noFile(['gradle/yeoman.gradle']);
 });
 it('creates expected files for default configuration for client generator', () => {
     assert.noFile(expectedFiles.server);
     assert.noFile(expectedFiles.maven);
     assert.file(getFilesForOptions(angularJsFiles, {
         useSass: true,
         enableTranslation: true,
         serviceDiscoveryType: false,
         authenticationType: 'jwt',
         testFrameworks: []
     }));
 });
 .then(function() {
   ygAssert.noFile(DOCKER_FILES);
   ygAssert.noFile(TOOLCHAIN_FILES);
   ygAssert.file('manifest.yml');
   var content = fs.readFileSync('./manifest.yml', 'utf8');
   var manifest = yaml.load(content);
   assert('1G', manifest.memory);
   assert(7, manifest.instances);
   assert('my.blue.mix.net', manifest.domain);
   assert('cool.app', manifest.host);
   assert('512M', manifest.disk_quota);
   assert('bluemix', manifest.env.NODE_ENV);
 });
 it('creates expected default files', function () {
     assert.file(expectedFiles.default);
     assert.noFile([
         'src/main/webapp/i18n/en/foo.json',
         'src/main/webapp/i18n/fr/foo.json'
     ])
 });
 it('creates expected files', function (/*done*/) {
   var expected = [
     // add files you expect to exist here.
     'widgets/TestWidget/Widget.js',
     'widgets/TestWidget/config.json',
     'widgets/TestWidget/css/style.css',
     'widgets/TestWidget/nls/strings.js',
     'widgets/TestWidget/images/icon.png',
     'widgets/TestWidget/manifest.json'
   ];
   assert.file(expected);
   assert.noFile('widgets/TestWidget/setting/Setting.js');
   assert.noFile('widgets/TestWidget/setting/Setting.html');
   assert.noFile('widgets/TestWidget/setting/css/style.css');
   assert.noFile('widgets/TestWidget/setting/nls/strings.js');
 });
Example #8
0
 it('does not create actions and tests', () => {
   assert.noFile([
     'actions.js',
     'test/reducer.test.js',
     'test/actions.test.js',
   ].map(f => `${appDirectory}/src/state/todos/${f}`));
 });
Example #9
0
test.skip.serial('generates expected files', async () => {
  helpers.mockPrompt(generator, {
    moduleName: 'test',
    githubUsername: '******',
    website: 'test.com',
    cli: false,
  })

  await pify(generator.run.bind(generator))()

  assert.file([
    '.editorconfig',
    '.git',
    '.gitattributes',
    '.gitignore',
    '.travis.yml',
    'index.js',
    'license',
    'package.json',
    'readme.md',
    'test.js',
  ])

  assert.noFile('cli.js')
})
Example #10
0
 it('should do none of that stuff', () => {
   assert.fileContent([
     ['task/dev.js', "['scripts', 'styles']"],
     ['task/prod.js', "['scripts', 'styles']"],
     ['task/prod.js', 'app/index.html']
   ]);
   assert.noFileContent([
     ['package.json', 'front-matter'],
     ['package.json', 'gulp-data'],
     ['package.json', 'gulp-template'],
     ['package.json', 'gulp-wrap'],
     ['package.json', 'yamljs'],
     ['task/dev.js', "gulp.task('views'"],
     ['task/dev.js', /ya?ml/i],
     ['task/prod.js', '.tmp/**/*.html'],
     ['app/index.html', '<%'],
     ['readme.md', 'templating logic for views']
   ]);
   assert.noFile([
     'data/message.yml',
     'app/views/index.html',
     'app/layouts/default.html'
   ]);
   assert.file('app/index.html');
   assert.noFileContent('app/index.html', '---');
 });
Example #11
0
 it('should have HTML templates', () => {
   assert.file([
     'app/views/index.html',
     'app/layouts/default.html'
   ]);
   assert.noFile('app/index.html');
 });
 it('did not create files', function () {
   assert.noFile([
     '.editorconfig',
     '.gitignore',
     'pom.xml',
     'debug.sh',
     'run.sh',
     'run.bat',
     'run-without-springloaded.sh',
     'scripts/debug.sh',
     'scripts/env.sh',
     'scripts/explode-alf-sources.sh',
     'scripts/find-exploded.sh',
     'scripts/grep-exploded.sh',
     'scripts/package-to-exploded.sh',
     'scripts/run.sh',
     'scripts/run.bat',
     'scripts/run-without-springloaded.sh',
     'amps/README.md',
     'amps_share/README.md',
     constants.FOLDER_CUSTOMIZATIONS + '/README.md',
     constants.FOLDER_CUSTOMIZATIONS + '/pom.xml',
     constants.FOLDER_SOURCE_TEMPLATES + '/README.md',
     constants.FOLDER_SOURCE_TEMPLATES + '/repo-amp/pom.xml',
     constants.FOLDER_SOURCE_TEMPLATES + '/share-amp/pom.xml',
     'repo/pom.xml',
     'runner/pom.xml',
     'share/pom.xml',
     'solr-config/pom.xml',
     'TODO.md',
   ]);
 });
 it('does not create javascript root object files', function () {
   const jsRootJavaFile = path.join(noProjectTempDir, 'temp-test-platform-jar/src/main/java/org/alfresco/jsroot/NoProject.java');
   const contextFile = path.join(noProjectTempDir, 'temp-test-platform-jar/src/main/resources/alfresco/module/temp-test-platform-jar/context/generated/jsroot-object-noproject-context.xml');
   assert.noFile([
     jsRootJavaFile,
     contextFile,
   ]);
 });
 it('creates expected default files', () => {
     assert.file(expectedFiles.server);
     assert.file(expectedFiles.clientNg2);
     assert.noFile([
         `${CLIENT_MAIN_SRC_DIR}i18n/en/foo.json`,
         `${CLIENT_MAIN_SRC_DIR}i18n/fr/foo.json`
     ]);
 });
 it('model files should not be generated', function () {
   const modelFile = path.join(osTempDir, 'repo-amp/src/main/amp/config/alfresco/module/repo-amp/model/generated/testModel.xml');
   const contextFile = path.join(osTempDir, 'repo-amp/src/main/amp/config/alfresco/module/repo-amp/context/generated/test-model-context.xml');
   assert.noFile([
     modelFile,
     contextFile,
   ]);
 });
 it('creates expected default files', function () {
     assert.file(expectedFiles.server);
     assert.file(expectedFiles.client);
     assert.noFile([
         CLIENT_MAIN_SRC_DIR + 'i18n/en/foo.json',
         CLIENT_MAIN_SRC_DIR + 'i18n/fr/foo.json'
     ]);
 });
 it('does not create action files', function () {
   const behaviorFile = path.join(noProjectTempDir, 'temp-test-platform-jar/src/main/java/org/alfresco/behaviors/NoProject.java');
   const contextFile = path.join(noProjectTempDir, 'temp-test-platform-jar/src/main/resources/alfresco/module/temp-test-platform-jar/context/generated/behavior-no-project-context.xml');
   assert.noFile([
     behaviorFile,
     contextFile,
   ]);
 });
      runGenerator.on('end', function () {
        assert.file(EXPECTED_FILES);

        assert.noFile([
          '.travis.yml',
        ]);

        done();
      });
Example #19
0
    it('does not create ignored files', function () {
      var unwanted = [
        'seed-element.html',
        '.npmignore',
        '.git'
      ];

      assert.noFile(unwanted);
    });
 it('does not create advanced files', function () {
   // TODO(bwavell): add more tests
   assert.noFile([
     'customizations/amps/README.md',
     'customizations/amps_share/README.md',
     'customizations/README.md',
     'customizations/pom.xml',
   ]);
 });
    it('Should properly create test files', () => {
      assert.file([
        'test/unit/hooks/PluralizeHook.test.js'
      ]);

      assert.noFile([
        'test/unit/hooks/CountHook.test.js'
      ]);
    });
 it('should not create a controller and view', () => {
   assert.noFile([
     'app/test-group/test-group-routes.js',
     'app/test-group/test-group-controller.js',
     'app/test-group/test-group-controller_test.js',
     'app/test-group/test-group.tpl.html',
     'e2e/test-group/test-group.po.js',
     'e2e/test-group/test-group_test.js'
   ]);
 });
 it('does not create action files', function () {
   const actionFile = path.join(noProjectTempDir, 'repo-amp/src/main/java/org/alfresco/actions/NoProjectActionExecuter.java');
   const contextFile = path.join(noProjectTempDir, 'repo-amp/src/main/amp/config/alfresco/module/repo-amp/context/generated/action-no-project-context.xml');
   const messageFile = path.join(noProjectTempDir, 'repo-amp/src/main/amp/config/alfresco/module/repo-amp/messages/repo-amp-no-project-action.properties');
   assert.noFile([
     actionFile,
     contextFile,
     messageFile,
   ]);
 });
	it('should create just the essential LESS files', () => {
		assert.noFile([
			'src/assets/less/' + _s.slugify(prompts.theme) + '/alerts.less',
			'src/assets/less/' + _s.slugify(prompts.theme) + '/demoElements.less',
			'src/assets/less/' + _s.slugify(prompts.theme) + '/footer.less',
			'src/assets/less/' + _s.slugify(prompts.theme) + '/ribbon.less',
			'src/assets/less/' + _s.slugify(prompts.theme) + '/mixins.less',
			'src/assets/less/' + _s.slugify(prompts.theme) + '/scaffolding.less'
		]);
	});
Example #25
0
      this.dummy.tarball('http://example.com/f.tar.gz', tmp, function (err) {
        if (err) {
          done(err);
          return;
        }

        assert.noFile(path.join(tmp, 'f.tar.gz'));
        assert(scope.isDone());
        done();
      });
 }).then(() => {
   yoAssert.file([
     path.join('app/components/foo', 'foo.directive.js'),
     path.join('app/components/foo', 'foo.directive.spec.js')
   ]);
   yoAssert.noFile([
     path.join('app/components/foo', 'foo.scss'),
     path.join('app/components/foo', 'foo.html')
   ]);
 });
 }).then(() => {
   yoAssert.file([
     path.join('client/app/foo', 'foo.directive.ts'),
     path.join('client/app/foo', 'foo.directive.spec.ts')
   ]);
   yoAssert.noFile([
     path.join('client/app/foo', 'foo.less'),
     path.join('client/app/foo', 'foo.jade')
   ]);
 });
 it('removes package based demo files', function () {
   assert.noFile([
     'repo-amp/src/main/java/foo/bar/baz/demoamp/Demo.java',
     'repo-amp/src/test/java/foo/bar/baz/demoamp/test/DemoComponentTest.java',
     'repo-amp/src/main/java/foo/bar/baz/demoamp/HelloWorldWebScript.java',
     'repo-amp/src/main/java/foo/bar/baz/demoamp',
     'repo-amp/src/test/java/foo/bar/baz/demoamp/test/DemoComponentTest.java',
     'repo-amp/src/test/java/foo/bar/baz/demoamp',
   ]);
 });
 it('latex generator', function (done) {
   assert.file([
     'package.json',
     'main.tex',
     'src/refs.bib',
     'Gruntfile.js',
     '.editorconfig'
   ]);
   assert.noFile('src/glos.bib');
   done();
 });
Example #30
0
        testutil.run(base, function (err) {
            assert.file([
                'public/templates/Foo.dust'
            ]);

            assert.noFile([
                'locales/US/en/Foo.properties'
            ]);

            done(err);
        });