Skip to content

Commit

Permalink
Testing setup for new feature: testing handler
Browse files Browse the repository at this point in the history
  • Loading branch information
UlisesGascon committed Jun 5, 2019
1 parent af7de2f commit 376642c
Show file tree
Hide file tree
Showing 3 changed files with 242 additions and 35 deletions.
3 changes: 1 addition & 2 deletions test/general.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ describe('general', () => {
'app/scripts/main.js',
'app/styles/main.css',
'app/images',
'app/fonts',
'test'
'app/fonts'
]);
});

Expand Down
33 changes: 0 additions & 33 deletions test/test-framework.js

This file was deleted.

241 changes: 241 additions & 0 deletions test/tests-handler.js
Original file line number Diff line number Diff line change
@@ -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
});
});
});

0 comments on commit 376642c

Please sign in to comment.