Skip to content

Commit

Permalink
Changes to blueprint constructor test.
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima committed Jul 14, 2020
1 parent ad08559 commit c16a4ff
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 39 deletions.
9 changes: 6 additions & 3 deletions test/blueprint/constructor-error-blueprint.spec.js
Expand Up @@ -11,15 +11,18 @@ describe('JHipster application generator with blueprint with constructor error',
.create('jhipster:app', {}, { createEnv: EnvironmentBuilder.createEnv })
.inTmpDir(dir => {
// Fake the presence of the blueprint in node_modules
const fakeBlueprintModuleDir = path.join(dir, 'node_modules/generator-jhipster-myblueprint');
const fakeBlueprintModuleDir = path.join(dir, 'node_modules', 'generator-jhipster-throwing-constructor');
fse.ensureDirSync(fakeBlueprintModuleDir);
fse.copySync(path.join(__dirname, '../../test/templates/throwing-blueprint'), fakeBlueprintModuleDir);
fse.copySync(
path.join(__dirname, '..', '..', 'test', 'templates', 'blueprints', 'generator-jhipster-throwing-constructor'),
fakeBlueprintModuleDir
);
})
.withOptions({
'from-cli': true,
skipInstall: true,
skipChecks: true,
blueprints: 'generator-jhipster-myblueprint',
blueprints: 'generator-jhipster-throwing-constructor',
baseName: 'jhipster',
defaults: true,
})
Expand Down
@@ -0,0 +1,8 @@
module.exports = { createGenerator: env =>
class extends env.requireGenerator('jhipster:server') {
constructor(args, opts) {
super(args, opts);
throw new Error('blueprint with error');
}
}
};
36 changes: 0 additions & 36 deletions test/templates/throwing-blueprint/generators/server/index.js

This file was deleted.

0 comments on commit c16a4ff

Please sign in to comment.