diff --git a/package.json b/package.json index c26e7551..357ffd4e 100644 --- a/package.json +++ b/package.json @@ -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", @@ -54,7 +54,8 @@ "eslintConfig": { "extends": "xo-space", "env": { - "mocha": true + "mocha": true, + "jest": true } }, "license": "MIT" diff --git a/subgenerator/index.js b/subgenerator/index.js index f1ee5d63..187bb052 100644 --- a/subgenerator/index.js +++ b/subgenerator/index.js @@ -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 diff --git a/subgenerator/templates/test.js b/subgenerator/templates/test.js index abd0d5f0..eaa46164 100644 --- a/subgenerator/templates/test.js +++ b/subgenerator/templates/test.js @@ -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}); }); diff --git a/test/app.js b/test/app.js index d7924b74..11c6aa43 100644 --- a/test/app.js +++ b/test/app.js @@ -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); diff --git a/test/subgenerator.js b/test/subgenerator.js index 7525b472..2bc5faf3 100644 --- a/test/subgenerator.js +++ b/test/subgenerator.js @@ -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', () => {