Skip to content

Commit

Permalink
Update generator-node and generated test
Browse files Browse the repository at this point in the history
  • Loading branch information
mischah committed Mar 27, 2017
1 parent de078b0 commit 2de453a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"dependencies": {
"chalk": "^1.1.3",
"deep-extend": "^0.4.1",
"generator-node": "^1.12.1",
"generator-node": "^2.0.1",
"inquirer-npm-name": "^2.0.0",
"lodash": "^4.17.2",
"mkdirp": "^0.5.1",
Expand All @@ -54,7 +54,8 @@
"eslintConfig": {
"extends": "xo-space",
"env": {
"mocha": true
"mocha": true,
"jest": true
}
},
"license": "MIT"
Expand Down
2 changes: 1 addition & 1 deletion subgenerator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module.exports = class extends Generator {

this.fs.copyTpl(
this.templatePath('test.js'),
this.destinationPath('test/' + this.options.name + '.js'),
this.destinationPath('__tests__/' + this.options.name + '.js'),
{
name: this.options.name,
generatorName
Expand Down
2 changes: 1 addition & 1 deletion subgenerator/templates/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var assert = require('yeoman-assert');
var helpers = require('yeoman-test');

describe('<%- generatorName %>:<%- name %>', () => {
before(() => {
beforeAll(() => {
return helpers.run(path.join(__dirname, '../generators/<%- name %>'))
.withPrompts({someAnswer: true});
});
Expand Down
2 changes: 1 addition & 1 deletion test/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe('generator:app', () => {
'package.json',
'generators/app/index.js',
'generators/app/templates/dummyfile.txt',
'test/app.js'
'__tests__/app.js'
];

assert.file(expected);
Expand Down
6 changes: 3 additions & 3 deletions test/subgenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ describe('generator:subgenerator', () => {
assert.file([
'generators/foo/index.js',
'generators/foo/templates/dummyfile.txt',
'test/foo.js'
'__tests__/foo.js'
]);
});

it('configures the test file', () => {
assert.fileContent('test/foo.js', 'describe(\'generator-foo:foo');
assert.fileContent('test/foo.js', '../generators/foo');
assert.fileContent('__tests__/foo.js', 'describe(\'generator-foo:foo');
assert.fileContent('__tests__/foo.js', '../generators/foo');
});

it('escapes possible apostrophes from superb', () => {
Expand Down

0 comments on commit 2de453a

Please sign in to comment.