Skip to content

Commit

Permalink
Make coverage pass
Browse files Browse the repository at this point in the history
  • Loading branch information
cherifGsoul committed Jul 4, 2019
1 parent 119c8ab commit 4379e67
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
3 changes: 2 additions & 1 deletion component/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ module.exports = class extends BaseGenerator {
validate: utils.validateRequired,
when: !this.options.name
}).then(function(first) {
var name = this.options.name = this.options.name || first.name;
var name = this.options.name || first.name;
name = this.options.name = name.replace(/\/$/, "");

this.isDoneComponent = this.options.name.indexOf('.component') !== -1;
this.options.name = name = name.replace('.component', '');
Expand Down
16 changes: 8 additions & 8 deletions test/component.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,16 +230,16 @@ describe('generator-donejs', function () {
skipInstall: true
})
.withPrompts({
name: 'basics/foo/ bar',
tag: 'foo-bar'
name: 'basics/past-year/ past-year',
name: 'basics/past-year/ past-year',
})
.on('end', function () {
assert(fs.existsSync(path.join(tmpDir, 'src', 'foo', 'bar', 'bar.js')), 'bar.js exists');
assert(fs.existsSync(path.join(tmpDir, 'src', 'foo', 'bar', 'bar.md')), 'bar.md exists');
assert(fs.existsSync(path.join(tmpDir, 'src', 'foo', 'bar', 'bar.less')), 'bar.less exists');
assert(fs.existsSync(path.join(tmpDir, 'src', 'foo', 'bar', 'bar.stache')), 'bar.stache exists');
assert(fs.existsSync(path.join(tmpDir, 'src', 'foo', 'bar', 'bar-test.js')), 'bar-test.js exists');
assert(fs.existsSync(path.join(tmpDir, 'src', 'foo', 'bar', 'bar.html')), 'bar.html exists');
assert(fs.existsSync(path.join(tmpDir, 'src', 'past-year', 'past-year', 'past-year.js')), 'past-year.js exists');
assert(fs.existsSync(path.join(tmpDir, 'src', 'past-year', 'past-year', 'past-year.md')), 'past-year.md exists');
assert(fs.existsSync(path.join(tmpDir, 'src', 'past-year', 'past-year', 'past-year.less')), 'past-year.less exists');
assert(fs.existsSync(path.join(tmpDir, 'src', 'past-year', 'past-year', 'past-year.stache')), 'past-year.stache exists');
assert(fs.existsSync(path.join(tmpDir, 'src', 'past-year', 'past-year', 'past-year-test.js')), 'past-year-test.js exists');
assert(fs.existsSync(path.join(tmpDir, 'src', 'past-year', 'past-year', 'past-year.html')), 'past-year.html exists');
done();
});
});
Expand Down

0 comments on commit 4379e67

Please sign in to comment.