From 376642c4b06f35a9495cb58c616eb1915305d871 Mon Sep 17 00:00:00 2001 From: ulises Gascon Date: Wed, 5 Jun 2019 12:54:22 +0200 Subject: [PATCH 01/15] Testing setup for new feature: testing handler --- test/general.js | 3 +- test/test-framework.js | 33 ------ test/tests-handler.js | 241 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 242 insertions(+), 35 deletions(-) delete mode 100644 test/test-framework.js create mode 100644 test/tests-handler.js diff --git a/test/general.js b/test/general.js index 2e6d42fe..50d4c8a0 100644 --- a/test/general.js +++ b/test/general.js @@ -33,8 +33,7 @@ describe('general', () => { 'app/scripts/main.js', 'app/styles/main.css', 'app/images', - 'app/fonts', - 'test' + 'app/fonts' ]); }); diff --git a/test/test-framework.js b/test/test-framework.js deleted file mode 100644 index 02d95de6..00000000 --- a/test/test-framework.js +++ /dev/null @@ -1,33 +0,0 @@ -const path = require('path'); -const helpers = require('yeoman-test'); -const assert = require('yeoman-assert'); - -describe('test framework', () => { - describe('mocha', () => { - before(done => { - helpers - .run(path.join(__dirname, '../app')) - .withOptions({ 'test-framework': 'mocha' }) - .withPrompts({ features: [] }) - .on('end', done); - }); - - it('generates the expected fixture', () => { - assert.fileContent('test/index.html', 'mocha'); - }); - }); - - describe('jasmine', () => { - before(done => { - helpers - .run(path.join(__dirname, '../app')) - .withOptions({ 'test-framework': 'jasmine' }) - .withPrompts({ features: [] }) - .on('end', done); - }); - - it('generates the expected fixture', () => { - assert.fileContent('test/index.html', 'jasmine'); - }); - }); -}); diff --git a/test/tests-handler.js b/test/tests-handler.js new file mode 100644 index 00000000..3b48a34e --- /dev/null +++ b/test/tests-handler.js @@ -0,0 +1,241 @@ +const path = require('path'); +const helpers = require('yeoman-test'); +//const assert = require('yeoman-assert'); + +describe.skip('Test handler', () => { + describe('When user refused unit and e2e tests directly', () => { + before(done => { + helpers + .run(path.join(__dirname, '../app')) + .withPrompts({ includeTest: false }) + .on('end', done); + }); + + it('Should not add unit tests', () => { + //@TODO + }); + + it('Should not add e2e tests', () => { + //@TODO + }); + }); + + describe.skip('When user agrees to add test but avoid to pick unit and e2e test', () => { + before(done => { + helpers + .run(path.join(__dirname, '../app')) + .withPrompts({ includeTest: true, testsWanted: [] }) + .on('end', done); + }); + + it('Should not add any unit tests', () => { + //@TODO + }); + + it('Should not add e2e tests', () => { + //@TODO + }); + }); + + describe.skip('When user agrees to test only e2e', () => { + before(done => { + helpers + .run(path.join(__dirname, '../app')) + .withPrompts({ includeTest: true, testsWanted: [] }) + .on('end', done); + }); + + it('Should not add any unit tests', () => { + //@TODO + }); + + it('Should add e2e tests', () => { + //@TODO + }); + }); + + describe.skip('When user agrees to e2e testing add Unit Testing (Ava)', () => { + before(done => { + helpers + .run(path.join(__dirname, '../app')) + .withPrompts({ + includeTest: true, + testsWanted: ['includeE2e', 'includeUnit'], + unitTestFramework: 'ava' + }) + .on('end', done); + }); + + it('Should add e2e tests', () => { + //@TODO + }); + + it('Should add unit tests for Ava', () => { + //@TODO + }); + + it('Should not add unit tests for Jest', () => { + //@TODO + }); + + it('Should not add unit tests for Jasmine', () => { + //@TODO + }); + + it('Should not add unit tests for Mocha (TDD)', () => { + //@TODO + }); + + it('Should not add unit tests for Mocha (BDD)', () => { + //@TODO + }); + }); + + describe.skip('When user agrees to add only Unit Testing (Jest)', () => { + before(done => { + helpers + .run(path.join(__dirname, '../app')) + .withPrompts({ + includeTest: true, + testsWanted: ['includeUnit'], + unitTestFramework: 'jest' + }) + .on('end', done); + }); + + it('Should not add e2e tests', () => { + //@TODO + }); + + it('Should add unit tests for Jest', () => { + //@TODO + }); + + it('Should not add unit tests for Ava', () => { + //@TODO + }); + + it('Should not add unit tests for Jasmine', () => { + //@TODO + }); + + it('Should not add unit tests for Mocha (TDD)', () => { + //@TODO + }); + + it('Should not add unit tests for Mocha (BDD)', () => { + //@TODO + }); + }); + + describe.skip('When user agrees to add only Unit Testing (Jasmine)', () => { + before(done => { + helpers + .run(path.join(__dirname, '../app')) + .withPrompts({ + includeTest: true, + testsWanted: ['includeUnit'], + unitTestFramework: 'jasmine' + }) + .on('end', done); + }); + + it('Should not add e2e tests', () => { + //@TODO + }); + + it('Should add unit tests for Jasmine', () => { + //@TODO + }); + + it('Should not add unit tests for Jest', () => { + //@TODO + }); + + it('Should not add unit tests for Ava', () => { + //@TODO + }); + + it('Should not add unit tests for Mocha (TDD)', () => { + //@TODO + }); + + it('Should not add unit tests for Mocha (BDD)', () => { + //@TODO + }); + }); + + describe.skip('When user agrees to add only Unit Testing for Mocha (TDD)', () => { + before(done => { + helpers + .run(path.join(__dirname, '../app')) + .withPrompts({ + includeTest: true, + testsWanted: ['includeUnit'], + unitTestFramework: 'mochaTdd' + }) + .on('end', done); + }); + + it('Should not add e2e tests', () => { + //@TODO + }); + + it('Should add unit tests for Mocha (TDD)', () => { + //@TODO + }); + + it('Should not add unit tests for Jasmine', () => { + //@TODO + }); + + it('Should not add unit tests for Jest', () => { + //@TODO + }); + + it('Should not add unit tests for Ava', () => { + //@TODO + }); + + it('Should not add unit tests for Mocha (BDD)', () => { + //@TODO + }); + }); + + describe.skip('When user agrees to add only Unit Testing for Mocha (BDD)', () => { + before(done => { + helpers + .run(path.join(__dirname, '../app')) + .withPrompts({ + includeTest: true, + testsWanted: ['includeUnit'], + unitTestFramework: 'mochaBdd' + }) + .on('end', done); + }); + + it('Should not add e2e tests', () => { + //@TODO + }); + + it('Should add unit tests for Mocha (BDD)', () => { + //@TODO + }); + + it('Should not add unit tests for Mocha (TDD)', () => { + //@TODO + }); + + it('Should not add unit tests for Jasmine', () => { + //@TODO + }); + + it('Should not add unit tests for Jest', () => { + //@TODO + }); + + it('Should not add unit tests for Ava', () => { + //@TODO + }); + }); +}); From f28cf21d3fdeb81aee1fdf18a1bee62fb23b2607 Mon Sep 17 00:00:00 2001 From: ulises Gascon Date: Wed, 5 Jun 2019 12:55:37 +0200 Subject: [PATCH 02/15] New workflow added for testing handler. #759 --- app/config.js | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 62 insertions(+), 1 deletion(-) diff --git a/app/config.js b/app/config.js index 6c501876..ca3399c0 100644 --- a/app/config.js +++ b/app/config.js @@ -47,7 +47,68 @@ module.exports = { name: 'includeJQuery', message: 'Would you like to include jQuery?', default: true, - when: answers => !answers.features.includes('includeBootstrap') + when: answers => + answers.features && !answers.features.includes('includeBootstrap') + }, + { + type: 'confirm', + name: 'includeTest', + message: 'Would you like to add testing?', + default: true + }, + { + type: 'checkbox', + name: 'testsWanted', + message: 'Which type of test would you like to cover?', + when: answers => answers.includeTest, + choices: [ + { + name: 'End to end (e2e)', + value: 'includeE2e', + checked: true + }, + { + name: 'Unit Test', + value: 'includeUnit', + checked: true + } + ] + }, + { + type: 'list', + name: 'unitTestFramework', + message: 'Which test framework would you like to use?', + when: answers => + answers.includeTest && + answers.testsWanted && + answers.testsWanted.includes('includeUnit'), + choices: [ + { + name: 'Jest', + value: 'jest', + checked: true + }, + { + name: 'Ava', + value: 'ava', + checked: true + }, + { + name: 'Jasmine', + value: 'jasmine', + checked: true + }, + { + name: 'Mocha (Testing driven design)', + value: 'mochaTdd', + checked: true + }, + { + name: 'Mocha (Behaviour Driven Design)', + value: 'mochaBdd', + checked: true + } + ] } ], dirsToCreate: ['app/images', 'app/fonts'], From 0599cc1a6845800bc0063c30b540b7dbc9fdbeb5 Mon Sep 17 00:00:00 2001 From: ulises Gascon Date: Wed, 5 Jun 2019 12:57:49 +0200 Subject: [PATCH 03/15] responsed added to the writing workflow - Replaced `--test-framework` argument in the initialization for prompts - Added new responses to global `this` following the current convention --- app/index.js | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/app/index.js b/app/index.js index af01b14b..be8cf307 100644 --- a/app/index.js +++ b/app/index.js @@ -15,14 +15,6 @@ module.exports = class extends Generator { initializing() { this.pkg = require('../package.json'); - this.composeWith( - require.resolve( - `generator-${this.options['test-framework']}/generators/app` - ), - { - 'skip-install': this.options['skip-install'] - } - ); } prompting() { @@ -36,7 +28,9 @@ module.exports = class extends Generator { return this.prompt(config.prompts).then(answers => { const features = answers.features; + const testsWanted = answers.testsWanted; const hasFeature = feat => features && features.includes(feat); + const hasTest = type => testsWanted && testsWanted.includes(type); // manually deal with the response, get back and store the results. // we change a bit this way of doing to automatically do this in the self.prompt() method. @@ -45,6 +39,10 @@ module.exports = class extends Generator { this.includeModernizr = hasFeature('includeModernizr'); this.includeAnalytics = hasFeature('includeAnalytics'); this.includeJQuery = answers.includeJQuery; + this.includeE2e = hasTest('includeE2e'); + this.includeUnit = hasTest('includeUnit'); + this.includeTest = this.includeE2e || this.includeUnit; + this.unitTestFramework = answers.unitTestFramework; }); } @@ -56,10 +54,13 @@ module.exports = class extends Generator { version: this.pkg.version, includeSass: this.includeSass, includeBootstrap: this.includeBootstrap, - testFramework: this.options['test-framework'], includeJQuery: this.includeJQuery, includeModernizr: this.includeModernizr, - includeAnalytics: this.includeAnalytics + includeAnalytics: this.includeAnalytics, + includeTest: this.includeTest, + includeE2e: this.includeE2e, + includeUnit: this.includeUnit, + unitTestFramework: this.unitTestFramework }; const copy = (input, output) => { From 6bf3174ee2e625a092500deed933c6751b63fa43 Mon Sep 17 00:00:00 2001 From: ulises Gascon Date: Wed, 5 Jun 2019 13:09:00 +0200 Subject: [PATCH 04/15] Removes unused generators As requested in #0599cc1a6845800bc0063c30b540b7dbc9fdbeb5 --- package.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/package.json b/package.json index 68ddb2c3..e57fe766 100644 --- a/package.json +++ b/package.json @@ -27,8 +27,6 @@ ], "dependencies": { "command-exists": "^1.2.8", - "generator-jasmine": "^2.0.1", - "generator-mocha": "^2.0.1", "mkdirp": "^0.5.1", "yeoman-generator": "^3.1.1", "yosay": "^2.0.2" From f541cd65980f68980ecbcb09ab696ddae1972a49 Mon Sep 17 00:00:00 2001 From: ulises Gascon Date: Wed, 5 Jun 2019 17:57:21 +0200 Subject: [PATCH 05/15] Added e2e testing with Cypress - Added test - Added tasks and dependencies to generated project - Added copy tasks to main writing task --- app/index.js | 4 ++ app/templates/_package.json | 15 ++++- app/templates/demo_cypress.js | 14 +++++ test/general.js | 1 - test/tests-handler.js | 108 +++++++++++++++++++--------------- 5 files changed, 92 insertions(+), 50 deletions(-) create mode 100644 app/templates/demo_cypress.js diff --git a/app/index.js b/app/index.js index be8cf307..1fca07a9 100644 --- a/app/index.js +++ b/app/index.js @@ -94,6 +94,10 @@ module.exports = class extends Generator { copy('modernizr.json', 'modernizr.json'); } + if (this.includeE2e) { + copy('demo_cypress.js', 'cypress/integration/index_spec.js'); + } + let cssFile = `main.${this.includeSass ? 'scss' : 'css'}`; copyTpl(cssFile, `app/styles/${cssFile}`, templateData); } diff --git a/app/templates/_package.json b/app/templates/_package.json index 008b59ea..4ff05416 100644 --- a/app/templates/_package.json +++ b/app/templates/_package.json @@ -21,6 +21,9 @@ "browser-sync": "^2.2.1", "cross-env": "^5.2.0", "cssnano": "^4.1.7", + <%_ if (includeE2e) { -%> + "cypress": "^3.3.1", + <%_ } -%> "del": "^3.0.0", "gulp": "^4.0.0", "gulp-babel": "^8.0.0", @@ -45,15 +48,23 @@ <%_ if (includeModernizr) { -%> "mkdirp": "^0.5.1", <%_ } -%> - "mocha": "^5.2.0", + <%_ if (includeE2e) { -%> + "start-server-and-test": "^1.9.1", + <%_ } -%> "yargs": "12.0.5" }, "scripts": { + <%_ if (includeE2e) { -%> + "test:e2e-open": "cypress open", + "test:e2e": "start-server-and-test start http://localhost:9000 test:e2e-open", + <%_ } -%> "serve:test": "cross-env NODE_ENV=test gulp serve", "serve:dist": "cross-env NODE_ENV=production gulp serve", "start": "gulp serve", "build": "cross-env NODE_ENV=production gulp", - "test": "npm run serve:test", + <%_ if (includeE2e) { -%> + "test": "npm run test:e2e", + <%_ } -%> "tasks": "gulp --tasks" }, "browserslist": [ diff --git a/app/templates/demo_cypress.js b/app/templates/demo_cypress.js new file mode 100644 index 00000000..50b3f2da --- /dev/null +++ b/app/templates/demo_cypress.js @@ -0,0 +1,14 @@ +describe('My First Test', function() { + beforeEach(() => { + cy.visit('http://localhost:9000') + }) + it('Should body exist', function() { + cy.get('body') + .should('be.visible') + }) + + it('Should contains title', function(){ + cy.get("h1") + .should('have.text', `'Allo, 'Allo!`) + }) + }) \ No newline at end of file diff --git a/test/general.js b/test/general.js index 50d4c8a0..4cd21e6f 100644 --- a/test/general.js +++ b/test/general.js @@ -42,7 +42,6 @@ describe('general', () => { assert.fileContent('package.json', '"serve:dist"'); assert.fileContent('package.json', '"start"'); assert.fileContent('package.json', '"build"'); - assert.fileContent('package.json', '"test"'); assert.fileContent('package.json', '"tasks"'); }); diff --git a/test/tests-handler.js b/test/tests-handler.js index 3b48a34e..462bd867 100644 --- a/test/tests-handler.js +++ b/test/tests-handler.js @@ -1,8 +1,22 @@ const path = require('path'); const helpers = require('yeoman-test'); -//const assert = require('yeoman-assert'); - -describe.skip('Test handler', () => { +const assert = require('yeoman-assert'); + +function e2ePresent() { + assert.fileContent('package.json', '"cypress": "'); + assert.fileContent('package.json', '"start-server-and-test": "'); + assert.fileContent('package.json', '"test:e2e-open": "'); + assert.fileContent('package.json', '"test:e2e": "'); +} + +function e2eNotPresent() { + assert.noFileContent('package.json', '"cypress": "'); + assert.noFileContent('package.json', '"start-server-and-test": "'); + assert.noFileContent('package.json', '"test:e2e-open": "'); + assert.noFileContent('package.json', '"test:e2e": "'); +} + +describe('Test handler', () => { describe('When user refused unit and e2e tests directly', () => { before(done => { helpers @@ -11,16 +25,16 @@ describe.skip('Test handler', () => { .on('end', done); }); - it('Should not add unit tests', () => { + it.skip('Should not add unit tests', () => { //@TODO }); it('Should not add e2e tests', () => { - //@TODO + e2eNotPresent(); }); }); - describe.skip('When user agrees to add test but avoid to pick unit and e2e test', () => { + describe('When user agrees to add test but avoid to pick unit and e2e test', () => { before(done => { helpers .run(path.join(__dirname, '../app')) @@ -28,33 +42,33 @@ describe.skip('Test handler', () => { .on('end', done); }); - it('Should not add any unit tests', () => { + it.skip('Should not add any unit tests', () => { //@TODO }); it('Should not add e2e tests', () => { - //@TODO + e2eNotPresent(); }); }); - describe.skip('When user agrees to test only e2e', () => { + describe('When user agrees to test only e2e', () => { before(done => { helpers .run(path.join(__dirname, '../app')) - .withPrompts({ includeTest: true, testsWanted: [] }) + .withPrompts({ includeTest: true, testsWanted: ['includeE2e'] }) .on('end', done); }); - it('Should not add any unit tests', () => { + it.skip('Should not add any unit tests', () => { //@TODO }); it('Should add e2e tests', () => { - //@TODO + e2ePresent(); }); }); - describe.skip('When user agrees to e2e testing add Unit Testing (Ava)', () => { + describe('When user agrees to e2e testing add Unit Testing (Ava)', () => { before(done => { helpers .run(path.join(__dirname, '../app')) @@ -67,31 +81,31 @@ describe.skip('Test handler', () => { }); it('Should add e2e tests', () => { - //@TODO + e2ePresent(); }); - it('Should add unit tests for Ava', () => { + it.skip('Should add unit tests for Ava', () => { //@TODO }); - it('Should not add unit tests for Jest', () => { + it.skip('Should not add unit tests for Jest', () => { //@TODO }); - it('Should not add unit tests for Jasmine', () => { + it.skip('Should not add unit tests for Jasmine', () => { //@TODO }); - it('Should not add unit tests for Mocha (TDD)', () => { + it.skip('Should not add unit tests for Mocha (TDD)', () => { //@TODO }); - it('Should not add unit tests for Mocha (BDD)', () => { + it.skip('Should not add unit tests for Mocha (BDD)', () => { //@TODO }); }); - describe.skip('When user agrees to add only Unit Testing (Jest)', () => { + describe('When user agrees to add only Unit Testing (Jest)', () => { before(done => { helpers .run(path.join(__dirname, '../app')) @@ -104,31 +118,31 @@ describe.skip('Test handler', () => { }); it('Should not add e2e tests', () => { - //@TODO + e2eNotPresent(); }); - it('Should add unit tests for Jest', () => { + it.skip('Should add unit tests for Jest', () => { //@TODO }); - it('Should not add unit tests for Ava', () => { + it.skip('Should not add unit tests for Ava', () => { //@TODO }); - it('Should not add unit tests for Jasmine', () => { + it.skip('Should not add unit tests for Jasmine', () => { //@TODO }); - it('Should not add unit tests for Mocha (TDD)', () => { + it.skip('Should not add unit tests for Mocha (TDD)', () => { //@TODO }); - it('Should not add unit tests for Mocha (BDD)', () => { + it.skip('Should not add unit tests for Mocha (BDD)', () => { //@TODO }); }); - describe.skip('When user agrees to add only Unit Testing (Jasmine)', () => { + describe('When user agrees to add only Unit Testing (Jasmine)', () => { before(done => { helpers .run(path.join(__dirname, '../app')) @@ -141,31 +155,31 @@ describe.skip('Test handler', () => { }); it('Should not add e2e tests', () => { - //@TODO + e2eNotPresent(); }); - it('Should add unit tests for Jasmine', () => { + it.skip('Should add unit tests for Jasmine', () => { //@TODO }); - it('Should not add unit tests for Jest', () => { + it.skip('Should not add unit tests for Jest', () => { //@TODO }); - it('Should not add unit tests for Ava', () => { + it.skip('Should not add unit tests for Ava', () => { //@TODO }); - it('Should not add unit tests for Mocha (TDD)', () => { + it.skip('Should not add unit tests for Mocha (TDD)', () => { //@TODO }); - it('Should not add unit tests for Mocha (BDD)', () => { + it.skip('Should not add unit tests for Mocha (BDD)', () => { //@TODO }); }); - describe.skip('When user agrees to add only Unit Testing for Mocha (TDD)', () => { + describe('When user agrees to add only Unit Testing for Mocha (TDD)', () => { before(done => { helpers .run(path.join(__dirname, '../app')) @@ -178,31 +192,31 @@ describe.skip('Test handler', () => { }); it('Should not add e2e tests', () => { - //@TODO + e2eNotPresent(); }); - it('Should add unit tests for Mocha (TDD)', () => { + it.skip('Should add unit tests for Mocha (TDD)', () => { //@TODO }); - it('Should not add unit tests for Jasmine', () => { + it.skip('Should not add unit tests for Jasmine', () => { //@TODO }); - it('Should not add unit tests for Jest', () => { + it.skip('Should not add unit tests for Jest', () => { //@TODO }); - it('Should not add unit tests for Ava', () => { + it.skip('Should not add unit tests for Ava', () => { //@TODO }); - it('Should not add unit tests for Mocha (BDD)', () => { + it.skip('Should not add unit tests for Mocha (BDD)', () => { //@TODO }); }); - describe.skip('When user agrees to add only Unit Testing for Mocha (BDD)', () => { + describe('When user agrees to add only Unit Testing for Mocha (BDD)', () => { before(done => { helpers .run(path.join(__dirname, '../app')) @@ -215,26 +229,26 @@ describe.skip('Test handler', () => { }); it('Should not add e2e tests', () => { - //@TODO + e2eNotPresent(); }); - it('Should add unit tests for Mocha (BDD)', () => { + it.skip('Should add unit tests for Mocha (BDD)', () => { //@TODO }); - it('Should not add unit tests for Mocha (TDD)', () => { + it.skip('Should not add unit tests for Mocha (TDD)', () => { //@TODO }); - it('Should not add unit tests for Jasmine', () => { + it.skip('Should not add unit tests for Jasmine', () => { //@TODO }); - it('Should not add unit tests for Jest', () => { + it.skip('Should not add unit tests for Jest', () => { //@TODO }); - it('Should not add unit tests for Ava', () => { + it.skip('Should not add unit tests for Ava', () => { //@TODO }); }); From 0b05190df7585f88f2d211071fb22fd1ff811f61 Mon Sep 17 00:00:00 2001 From: ulises Gascon Date: Wed, 5 Jun 2019 18:43:31 +0200 Subject: [PATCH 06/15] Basic support for unit testing added #759 - Babel config now supports modules (imp/exp) - Added module support in the index.html - Added sample function in main.js for future unit testing - Tests updated --- app/templates/babelrc | 9 +++++++-- app/templates/index.html | 4 ++++ app/templates/main.js | 10 +++++++++- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/app/templates/babelrc b/app/templates/babelrc index a29ac998..17ab5760 100644 --- a/app/templates/babelrc +++ b/app/templates/babelrc @@ -1,5 +1,10 @@ { "presets": [ - "@babel/preset-env" + ["@babel/preset-env", { + "sourceType": "unambiguous", + "targets": { + "esmodules": true + } + }] ] -} +} \ No newline at end of file diff --git a/app/templates/index.html b/app/templates/index.html index ed9664f8..3e418190 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -116,7 +116,11 @@

'Allo, 'Allo!

<%_ } -%> + <%_ if (includeUnit) { -%> + + <%_ } else { -%> + <%_ } -%> diff --git a/app/templates/main.js b/app/templates/main.js index 3b21d0d9..cb478f12 100644 --- a/app/templates/main.js +++ b/app/templates/main.js @@ -1,4 +1,12 @@ -console.log('\'Allo \'Allo!'); +<%_ if (includeUnit) { -%> +export function greeting() { + return '\'Allo \'Allo!'; +} + +console.log(greeting()); +<%_ } else { -%> + console.log('\'Allo \'Allo!'); +<%_ } -%> <%_ if (includeBootstrap) { -%> // Uncomment to enable Bootstrap tooltips From 99d135e500fe6e25666e560afc46e4961e4c0736 Mon Sep 17 00:00:00 2001 From: ulises Gascon Date: Wed, 5 Jun 2019 18:43:31 +0200 Subject: [PATCH 07/15] Revert "Basic support for unit testing added #759" This reverts commit 0b05190df7585f88f2d211071fb22fd1ff811f61. --- app/templates/babelrc | 9 ++------- app/templates/index.html | 4 ---- app/templates/main.js | 10 +--------- 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/app/templates/babelrc b/app/templates/babelrc index 17ab5760..a29ac998 100644 --- a/app/templates/babelrc +++ b/app/templates/babelrc @@ -1,10 +1,5 @@ { "presets": [ - ["@babel/preset-env", { - "sourceType": "unambiguous", - "targets": { - "esmodules": true - } - }] + "@babel/preset-env" ] -} \ No newline at end of file +} diff --git a/app/templates/index.html b/app/templates/index.html index 3e418190..ed9664f8 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -116,11 +116,7 @@

'Allo, 'Allo!

<%_ } -%> - <%_ if (includeUnit) { -%> - - <%_ } else { -%> - <%_ } -%> diff --git a/app/templates/main.js b/app/templates/main.js index cb478f12..3b21d0d9 100644 --- a/app/templates/main.js +++ b/app/templates/main.js @@ -1,12 +1,4 @@ -<%_ if (includeUnit) { -%> -export function greeting() { - return '\'Allo \'Allo!'; -} - -console.log(greeting()); -<%_ } else { -%> - console.log('\'Allo \'Allo!'); -<%_ } -%> +console.log('\'Allo \'Allo!'); <%_ if (includeBootstrap) { -%> // Uncomment to enable Bootstrap tooltips From c95d9d686f953b92d6509004ddd5b60b2b274652 Mon Sep 17 00:00:00 2001 From: ulises Gascon Date: Wed, 5 Jun 2019 18:46:45 +0200 Subject: [PATCH 08/15] Auto stash before revert of "Basic support for unit testing added #759" --- test/tests-handler.js | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/test/tests-handler.js b/test/tests-handler.js index 462bd867..d73fe7b4 100644 --- a/test/tests-handler.js +++ b/test/tests-handler.js @@ -2,6 +2,18 @@ const path = require('path'); const helpers = require('yeoman-test'); const assert = require('yeoman-assert'); +function unitPresent() { + assert.fileContent('app/index.html', 'type="module" src="scripts/main.js"'); + assert.fileContent('app/scripts/main.js', 'export function greeting'); + assert.fileContent('package.json', '"test:unit": "'); +} + +function unitNotPresent() { + assert.noFileContent('app/index.html', 'type="module" src="scripts/main.js"'); + assert.noFileContent('app/scripts/main.js', 'export function greeting'); + assert.noFileContent('package.json', '"test:unit": "'); +} + function e2ePresent() { assert.fileContent('package.json', '"cypress": "'); assert.fileContent('package.json', '"start-server-and-test": "'); @@ -26,7 +38,7 @@ describe('Test handler', () => { }); it.skip('Should not add unit tests', () => { - //@TODO + unitNotPresent(); }); it('Should not add e2e tests', () => { @@ -43,7 +55,7 @@ describe('Test handler', () => { }); it.skip('Should not add any unit tests', () => { - //@TODO + unitNotPresent(); }); it('Should not add e2e tests', () => { @@ -60,7 +72,7 @@ describe('Test handler', () => { }); it.skip('Should not add any unit tests', () => { - //@TODO + unitNotPresent(); }); it('Should add e2e tests', () => { @@ -84,7 +96,12 @@ describe('Test handler', () => { e2ePresent(); }); + it.skip('Should add unit tests Basics', () => { + unitPresent(); + }); + it.skip('Should add unit tests for Ava', () => { + unitPresent(); //@TODO }); @@ -121,6 +138,10 @@ describe('Test handler', () => { e2eNotPresent(); }); + it.skip('Should add unit tests Basics', () => { + unitPresent(); + }); + it.skip('Should add unit tests for Jest', () => { //@TODO }); @@ -158,6 +179,10 @@ describe('Test handler', () => { e2eNotPresent(); }); + it.skip('Should add unit tests Basics', () => { + unitPresent(); + }); + it.skip('Should add unit tests for Jasmine', () => { //@TODO }); @@ -195,6 +220,10 @@ describe('Test handler', () => { e2eNotPresent(); }); + it.skip('Should add unit tests Basics', () => { + unitPresent(); + }); + it.skip('Should add unit tests for Mocha (TDD)', () => { //@TODO }); @@ -232,6 +261,10 @@ describe('Test handler', () => { e2eNotPresent(); }); + it.skip('Should add unit tests Basics', () => { + unitPresent(); + }); + it.skip('Should add unit tests for Mocha (BDD)', () => { //@TODO }); From fe570f57208ba0fd6c40a77e68663deb731e5a85 Mon Sep 17 00:00:00 2001 From: ulises Gascon Date: Wed, 5 Jun 2019 18:46:45 +0200 Subject: [PATCH 09/15] Auto stash before revert of "Basic support for unit testing added #759" --- test/tests-handler.js | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/test/tests-handler.js b/test/tests-handler.js index 462bd867..d73fe7b4 100644 --- a/test/tests-handler.js +++ b/test/tests-handler.js @@ -2,6 +2,18 @@ const path = require('path'); const helpers = require('yeoman-test'); const assert = require('yeoman-assert'); +function unitPresent() { + assert.fileContent('app/index.html', 'type="module" src="scripts/main.js"'); + assert.fileContent('app/scripts/main.js', 'export function greeting'); + assert.fileContent('package.json', '"test:unit": "'); +} + +function unitNotPresent() { + assert.noFileContent('app/index.html', 'type="module" src="scripts/main.js"'); + assert.noFileContent('app/scripts/main.js', 'export function greeting'); + assert.noFileContent('package.json', '"test:unit": "'); +} + function e2ePresent() { assert.fileContent('package.json', '"cypress": "'); assert.fileContent('package.json', '"start-server-and-test": "'); @@ -26,7 +38,7 @@ describe('Test handler', () => { }); it.skip('Should not add unit tests', () => { - //@TODO + unitNotPresent(); }); it('Should not add e2e tests', () => { @@ -43,7 +55,7 @@ describe('Test handler', () => { }); it.skip('Should not add any unit tests', () => { - //@TODO + unitNotPresent(); }); it('Should not add e2e tests', () => { @@ -60,7 +72,7 @@ describe('Test handler', () => { }); it.skip('Should not add any unit tests', () => { - //@TODO + unitNotPresent(); }); it('Should add e2e tests', () => { @@ -84,7 +96,12 @@ describe('Test handler', () => { e2ePresent(); }); + it.skip('Should add unit tests Basics', () => { + unitPresent(); + }); + it.skip('Should add unit tests for Ava', () => { + unitPresent(); //@TODO }); @@ -121,6 +138,10 @@ describe('Test handler', () => { e2eNotPresent(); }); + it.skip('Should add unit tests Basics', () => { + unitPresent(); + }); + it.skip('Should add unit tests for Jest', () => { //@TODO }); @@ -158,6 +179,10 @@ describe('Test handler', () => { e2eNotPresent(); }); + it.skip('Should add unit tests Basics', () => { + unitPresent(); + }); + it.skip('Should add unit tests for Jasmine', () => { //@TODO }); @@ -195,6 +220,10 @@ describe('Test handler', () => { e2eNotPresent(); }); + it.skip('Should add unit tests Basics', () => { + unitPresent(); + }); + it.skip('Should add unit tests for Mocha (TDD)', () => { //@TODO }); @@ -232,6 +261,10 @@ describe('Test handler', () => { e2eNotPresent(); }); + it.skip('Should add unit tests Basics', () => { + unitPresent(); + }); + it.skip('Should add unit tests for Mocha (BDD)', () => { //@TODO }); From bb3b2d12d4adbbe0a2c8c5488ef6e9946c2d5b8e Mon Sep 17 00:00:00 2001 From: ulises Gascon Date: Wed, 5 Jun 2019 18:50:18 +0200 Subject: [PATCH 10/15] Basic support for unit testing added #759 - Babel config now supports modules (imp/exp) - Added module support in the index.html - Added sample function in main.js for future unit testing - Tests updated --- app/templates/babelrc | 7 ++++++- app/templates/index.html | 4 ++++ app/templates/main.js | 10 +++++++++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/app/templates/babelrc b/app/templates/babelrc index a29ac998..4a7ff2ba 100644 --- a/app/templates/babelrc +++ b/app/templates/babelrc @@ -1,5 +1,10 @@ { "presets": [ - "@babel/preset-env" + ["@babel/preset-env", { + "sourceType": "unambiguous", + "targets": { + "esmodules": true + } + }] ] } diff --git a/app/templates/index.html b/app/templates/index.html index ed9664f8..3e418190 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -116,7 +116,11 @@

'Allo, 'Allo!

<%_ } -%> + <%_ if (includeUnit) { -%> + + <%_ } else { -%> + <%_ } -%> diff --git a/app/templates/main.js b/app/templates/main.js index 3b21d0d9..cb478f12 100644 --- a/app/templates/main.js +++ b/app/templates/main.js @@ -1,4 +1,12 @@ -console.log('\'Allo \'Allo!'); +<%_ if (includeUnit) { -%> +export function greeting() { + return '\'Allo \'Allo!'; +} + +console.log(greeting()); +<%_ } else { -%> + console.log('\'Allo \'Allo!'); +<%_ } -%> <%_ if (includeBootstrap) { -%> // Uncomment to enable Bootstrap tooltips From 69949d01e88d4b0e31f65879ee9255b3919fd61c Mon Sep 17 00:00:00 2001 From: ulises Gascon Date: Wed, 5 Jun 2019 19:59:46 +0200 Subject: [PATCH 11/15] Jest added #759 - Updated generator tests - Improved combined tests behaviour (e2e + unit) as single task - Added Jest sample test based in main.js' greetings function --- app/index.js | 4 +++ app/templates/_package.json | 16 ++++++++- app/templates/demo_jest.js | 5 +++ test/tests-handler.js | 70 +++++++++++++++++++++++++++++-------- 4 files changed, 79 insertions(+), 16 deletions(-) create mode 100644 app/templates/demo_jest.js diff --git a/app/index.js b/app/index.js index 1fca07a9..8d96fa21 100644 --- a/app/index.js +++ b/app/index.js @@ -98,6 +98,10 @@ module.exports = class extends Generator { copy('demo_cypress.js', 'cypress/integration/index_spec.js'); } + if (this.includeUnit && this.unitTestFramework === 'jest') { + copy('demo_jest.js', '__test__/main.test.js'); + } + let cssFile = `main.${this.includeSass ? 'scss' : 'css'}`; copyTpl(cssFile, `app/styles/${cssFile}`, templateData); } diff --git a/app/templates/_package.json b/app/templates/_package.json index 4ff05416..64491a41 100644 --- a/app/templates/_package.json +++ b/app/templates/_package.json @@ -45,6 +45,9 @@ "gulp-sourcemaps": "^2.2.0", "gulp-uglify": "^3.0.1", "gulp-useref": "^3.0.0", + <%_ if (includeUnit && unitTestFramework === 'jest') { -%> + "jest": "^24.8.0", + <%_ } -%> <%_ if (includeModernizr) { -%> "mkdirp": "^0.5.1", <%_ } -%> @@ -54,6 +57,11 @@ "yargs": "12.0.5" }, "scripts": { + <%_ if (includeUnit && unitTestFramework === "jest") { -%> + "test:unit": "jest", + "test:unit-coverage": "jest --coverage", + "test:unit-watch": "jest --watchAll", + <%_ } -%> <%_ if (includeE2e) { -%> "test:e2e-open": "cypress open", "test:e2e": "start-server-and-test start http://localhost:9000 test:e2e-open", @@ -62,9 +70,15 @@ "serve:dist": "cross-env NODE_ENV=production gulp serve", "start": "gulp serve", "build": "cross-env NODE_ENV=production gulp", - <%_ if (includeE2e) { -%> + <%_ if (includeE2e && !includeUnit) { -%> "test": "npm run test:e2e", <%_ } -%> + <%_ if (includeUnit && !includeE2e) { -%> + "test": "npm run test:unit", + <%_ } -%> + <%_ if (includeE2e && includeUnit) { -%> + "test": "npm run test:unit && npm run test:e2e", + <%_ } -%> "tasks": "gulp --tasks" }, "browserslist": [ diff --git a/app/templates/demo_jest.js b/app/templates/demo_jest.js new file mode 100644 index 00000000..fb481b5b --- /dev/null +++ b/app/templates/demo_jest.js @@ -0,0 +1,5 @@ +import { greeting } from '../app/scripts/main.js' + +test('Say Allo!', () => { + expect(greeting()).toBe('\'Allo \'Allo!'); +}); \ No newline at end of file diff --git a/test/tests-handler.js b/test/tests-handler.js index d73fe7b4..b66acc1a 100644 --- a/test/tests-handler.js +++ b/test/tests-handler.js @@ -2,6 +2,25 @@ const path = require('path'); const helpers = require('yeoman-test'); const assert = require('yeoman-assert'); +function jestPresent() { + assert.fileContent('package.json', '"test:unit": "jest"'); + assert.fileContent('package.json', '"test:unit-coverage": "jest --coverage"'); + assert.fileContent('package.json', '"test:unit-watch": "jest --watchAll"'); + assert.fileContent('package.json', '"jest": '); + assert.file('__test__/main.test.js'); +} + +function jestNotPresent() { + assert.noFileContent('package.json', '"test:unit": "jest"'); + assert.noFileContent( + 'package.json', + '"test:unit-coverage": "jest --coverage"' + ); + assert.noFileContent('package.json', '"test:unit-watch": "jest --watchAll"'); + assert.noFileContent('package.json', '"jest": '); + assert.noFile('__test__/main.test.js'); +} + function unitPresent() { assert.fileContent('app/index.html', 'type="module" src="scripts/main.js"'); assert.fileContent('app/scripts/main.js', 'export function greeting'); @@ -37,13 +56,17 @@ describe('Test handler', () => { .on('end', done); }); - it.skip('Should not add unit tests', () => { + it('Should not add unit tests', () => { unitNotPresent(); }); it('Should not add e2e tests', () => { e2eNotPresent(); }); + + it('Should not create tests tasks', () => { + assert.noFileContent('package.json', '"test": '); + }); }); describe('When user agrees to add test but avoid to pick unit and e2e test', () => { @@ -54,13 +77,17 @@ describe('Test handler', () => { .on('end', done); }); - it.skip('Should not add any unit tests', () => { + it('Should not add any unit tests', () => { unitNotPresent(); }); it('Should not add e2e tests', () => { e2eNotPresent(); }); + + it('Should not create tests tasks', () => { + assert.noFileContent('package.json', '"test": '); + }); }); describe('When user agrees to test only e2e', () => { @@ -71,13 +98,20 @@ describe('Test handler', () => { .on('end', done); }); - it.skip('Should not add any unit tests', () => { + it('Should not add any unit tests', () => { unitNotPresent(); }); it('Should add e2e tests', () => { e2ePresent(); }); + + it('Should not create combined tests task', () => { + assert.noFileContent( + 'package.json', + '"test": "npm run test:unit && npm run test:e2e"' + ); + }); }); describe('When user agrees to e2e testing add Unit Testing (Ava)', () => { @@ -100,13 +134,19 @@ describe('Test handler', () => { unitPresent(); }); + it('Should create combined tests task', () => { + assert.fileContent( + 'package.json', + '"test": "npm run test:unit && npm run test:e2e"' + ); + }); + it.skip('Should add unit tests for Ava', () => { - unitPresent(); //@TODO }); - it.skip('Should not add unit tests for Jest', () => { - //@TODO + it('Should not add unit tests for Jest', () => { + jestNotPresent(); }); it.skip('Should not add unit tests for Jasmine', () => { @@ -138,12 +178,12 @@ describe('Test handler', () => { e2eNotPresent(); }); - it.skip('Should add unit tests Basics', () => { + it('Should add unit tests Basics', () => { unitPresent(); }); - it.skip('Should add unit tests for Jest', () => { - //@TODO + it('Should add unit tests for Jest', () => { + jestPresent(); }); it.skip('Should not add unit tests for Ava', () => { @@ -187,8 +227,8 @@ describe('Test handler', () => { //@TODO }); - it.skip('Should not add unit tests for Jest', () => { - //@TODO + it('Should not add unit tests for Jest', () => { + jestNotPresent(); }); it.skip('Should not add unit tests for Ava', () => { @@ -232,8 +272,8 @@ describe('Test handler', () => { //@TODO }); - it.skip('Should not add unit tests for Jest', () => { - //@TODO + it('Should not add unit tests for Jest', () => { + jestNotPresent(); }); it.skip('Should not add unit tests for Ava', () => { @@ -277,8 +317,8 @@ describe('Test handler', () => { //@TODO }); - it.skip('Should not add unit tests for Jest', () => { - //@TODO + it('Should not add unit tests for Jest', () => { + jestNotPresent(); }); it.skip('Should not add unit tests for Ava', () => { From c58037cfc72dfab9b23b92b21bb2878e869c2bbd Mon Sep 17 00:00:00 2001 From: ulises Gascon Date: Wed, 5 Jun 2019 21:01:42 +0200 Subject: [PATCH 12/15] Typo in babel syntaxis --- app/templates/babelrc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/templates/babelrc b/app/templates/babelrc index 4a7ff2ba..59ffdf46 100644 --- a/app/templates/babelrc +++ b/app/templates/babelrc @@ -1,10 +1,9 @@ { "presets": [ ["@babel/preset-env", { - "sourceType": "unambiguous", "targets": { "esmodules": true } }] ] -} +} \ No newline at end of file From f20f1bfd3a685cd46822d3b3678f2cda7cc2dcaf Mon Sep 17 00:00:00 2001 From: ulises Gascon Date: Wed, 5 Jun 2019 21:03:04 +0200 Subject: [PATCH 13/15] Ava added yeoman#759 - Updated generator tests - Added Ava sample test based in main.js' greetings function --- app/index.js | 4 ++++ app/templates/_package.json | 24 +++++++++++++++++++ app/templates/demo_ava.js | 6 +++++ test/tests-handler.js | 48 +++++++++++++++++++++++++++---------- 4 files changed, 70 insertions(+), 12 deletions(-) create mode 100644 app/templates/demo_ava.js diff --git a/app/index.js b/app/index.js index 8d96fa21..5a6feeef 100644 --- a/app/index.js +++ b/app/index.js @@ -102,6 +102,10 @@ module.exports = class extends Generator { copy('demo_jest.js', '__test__/main.test.js'); } + if (this.includeUnit && this.unitTestFramework === 'ava') { + copy('demo_ava.js', '__test__/main.test.js'); + } + let cssFile = `main.${this.includeSass ? 'scss' : 'css'}`; copyTpl(cssFile, `app/styles/${cssFile}`, templateData); } diff --git a/app/templates/_package.json b/app/templates/_package.json index 64491a41..2448f8c3 100644 --- a/app/templates/_package.json +++ b/app/templates/_package.json @@ -15,6 +15,9 @@ <%_ } -%> }, "devDependencies": { + <%_ if (includeUnit && unitTestFramework === 'ava') { -%> + "ava": "^2.0.0", + <%_ } -%> "@babel/core": "^7.1.2", "@babel/preset-env": "^7.1.0", "autoprefixer": "^9.4.4", @@ -25,6 +28,9 @@ "cypress": "^3.3.1", <%_ } -%> "del": "^3.0.0", + <%_ if (includeUnit && unitTestFramework === 'ava') { -%> + "esm": "^3.2.25" + <%_ } -%> "gulp": "^4.0.0", "gulp-babel": "^8.0.0", "gulp-cli": "^2.0.1", @@ -51,12 +57,30 @@ <%_ if (includeModernizr) { -%> "mkdirp": "^0.5.1", <%_ } -%> + <%_ if (includeUnit && unitTestFramework === 'ava') { -%> + "nyc": "^14.1.1", + <%_ } -%> <%_ if (includeE2e) { -%> "start-server-and-test": "^1.9.1", <%_ } -%> "yargs": "12.0.5" }, + <%_ if (includeUnit && unitTestFramework === 'ava') { -%> + "ava": { + "files": [ + "__test__/**/*.js" + ], + "require": [ + "esm" + ] + }, + <%_ } -%> "scripts": { + <%_ if (includeUnit && unitTestFramework === "ava") { -%> + "test:unit": "ava --verbose", + "test:unit-coverage": "nyc ava", + "test:unit-watch": "ava --verbose --watch", + <%_ } -%> <%_ if (includeUnit && unitTestFramework === "jest") { -%> "test:unit": "jest", "test:unit-coverage": "jest --coverage", diff --git a/app/templates/demo_ava.js b/app/templates/demo_ava.js new file mode 100644 index 00000000..aafd702f --- /dev/null +++ b/app/templates/demo_ava.js @@ -0,0 +1,6 @@ +import test from 'ava'; +import { greeting } from '../app/scripts/main.js' + +test('Say Allo!', t => { + t.is(greeting(), '\'Allo \'Allo!'); +}); \ No newline at end of file diff --git a/test/tests-handler.js b/test/tests-handler.js index b66acc1a..23558d81 100644 --- a/test/tests-handler.js +++ b/test/tests-handler.js @@ -2,6 +2,30 @@ const path = require('path'); const helpers = require('yeoman-test'); const assert = require('yeoman-assert'); +function avaPresent() { + assert.fileContent('package.json', '"test:unit": "ava --verbose"'); + assert.fileContent('package.json', '"test:unit-coverage": "nyc ava"'); + assert.fileContent( + 'package.json', + '"test:unit-watch": "ava --verbose --watch"' + ); + assert.fileContent('package.json', '"ava": '); + assert.fileContent('package.json', '"nyc": '); + assert.fileContent('package.json', '"esm": '); + assert.fileContent('package.json', '"ava": {'); + assert.file('__test__/main.test.js'); +} + +function avaNotPresent() { + assert.noFileContent('package.json', '"test:unit": "ava"'); + assert.noFileContent('package.json', '"test:unit-coverage": "nyc ava"'); + assert.noFileContent('package.json', '"test:unit-watch": "ava --watchAll"'); + assert.noFileContent('package.json', '"ava": '); + assert.noFileContent('package.json', '"nyc": '); + assert.noFileContent('package.json', '"esm": '); + assert.noFileContent('package.json', '"ava": {'); +} + function jestPresent() { assert.fileContent('package.json', '"test:unit": "jest"'); assert.fileContent('package.json', '"test:unit-coverage": "jest --coverage"'); @@ -18,7 +42,6 @@ function jestNotPresent() { ); assert.noFileContent('package.json', '"test:unit-watch": "jest --watchAll"'); assert.noFileContent('package.json', '"jest": '); - assert.noFile('__test__/main.test.js'); } function unitPresent() { @@ -31,6 +54,7 @@ function unitNotPresent() { assert.noFileContent('app/index.html', 'type="module" src="scripts/main.js"'); assert.noFileContent('app/scripts/main.js', 'export function greeting'); assert.noFileContent('package.json', '"test:unit": "'); + assert.noFile('__test__/main.test.js'); } function e2ePresent() { @@ -130,7 +154,7 @@ describe('Test handler', () => { e2ePresent(); }); - it.skip('Should add unit tests Basics', () => { + it('Should add unit tests Basics', () => { unitPresent(); }); @@ -141,8 +165,8 @@ describe('Test handler', () => { ); }); - it.skip('Should add unit tests for Ava', () => { - //@TODO + it('Should add unit tests for Ava', () => { + avaPresent(); }); it('Should not add unit tests for Jest', () => { @@ -186,8 +210,8 @@ describe('Test handler', () => { jestPresent(); }); - it.skip('Should not add unit tests for Ava', () => { - //@TODO + it('Should not add unit tests for Ava', () => { + avaNotPresent(); }); it.skip('Should not add unit tests for Jasmine', () => { @@ -231,8 +255,8 @@ describe('Test handler', () => { jestNotPresent(); }); - it.skip('Should not add unit tests for Ava', () => { - //@TODO + it('Should not add unit tests for Ava', () => { + avaNotPresent(); }); it.skip('Should not add unit tests for Mocha (TDD)', () => { @@ -276,8 +300,8 @@ describe('Test handler', () => { jestNotPresent(); }); - it.skip('Should not add unit tests for Ava', () => { - //@TODO + it('Should not add unit tests for Ava', () => { + avaNotPresent(); }); it.skip('Should not add unit tests for Mocha (BDD)', () => { @@ -321,8 +345,8 @@ describe('Test handler', () => { jestNotPresent(); }); - it.skip('Should not add unit tests for Ava', () => { - //@TODO + it('Should not add unit tests for Ava', () => { + avaNotPresent(); }); }); }); From c4f4ecb5106b33d7846af05f41ab84f061ad690e Mon Sep 17 00:00:00 2001 From: ulises Gascon Date: Wed, 5 Jun 2019 21:08:56 +0200 Subject: [PATCH 14/15] Just a typo :sweat: Sorry for that! --- app/templates/_package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/templates/_package.json b/app/templates/_package.json index 2448f8c3..44b2a116 100644 --- a/app/templates/_package.json +++ b/app/templates/_package.json @@ -29,7 +29,7 @@ <%_ } -%> "del": "^3.0.0", <%_ if (includeUnit && unitTestFramework === 'ava') { -%> - "esm": "^3.2.25" + "esm": "^3.2.25", <%_ } -%> "gulp": "^4.0.0", "gulp-babel": "^8.0.0", From 2835f4a4a053270662ec4a7771dee76482468c32 Mon Sep 17 00:00:00 2001 From: ulises Gascon Date: Mon, 10 Jun 2019 10:46:03 +0200 Subject: [PATCH 15/15] typo --- app/templates/_package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/templates/_package.json b/app/templates/_package.json index 65619668..505ed22f 100644 --- a/app/templates/_package.json +++ b/app/templates/_package.json @@ -18,9 +18,9 @@ <%_ if (includeUnit && unitTestFramework === 'ava') { -%> "ava": "^2.0.0", <%_ } -%> - "autoprefixer": "^9.5.1", "@babel/core": "^7.4.5", "@babel/preset-env": "^7.4.5", + "autoprefixer": "^9.5.1", "browser-sync": "^2.26.5", "cross-env": "^5.2.0", <%_ if (includeE2e) { -%>