Matteo Scandolo | 41d9f72 | 2016-05-11 09:03:25 -0700 | [diff] [blame^] | 1 | 'use strict'; |
| 2 | |
| 3 | const path = require('path'); |
| 4 | const helpers = require('yeoman-test'); |
| 5 | const assert = require('yeoman-assert'); |
| 6 | |
| 7 | const testPath = path.join(__dirname, '../../../ngXosViews/test-name/'); |
| 8 | |
| 9 | const getDefaultFiles = () => { |
| 10 | return [ |
| 11 | testPath + 'src/index.html', |
| 12 | testPath + '.bowerrc', |
| 13 | testPath + '.gitignore', |
| 14 | testPath + '.eslintrc', |
| 15 | testPath + 'gulpfile.js', |
| 16 | testPath + 'package.json', |
| 17 | testPath + 'bower.json' |
| 18 | ]; |
| 19 | }; |
| 20 | |
| 21 | describe('Yeoman XOS generator', function () { |
| 22 | |
| 23 | beforeEach(function () { |
| 24 | this.generator = helpers |
| 25 | .run(require.resolve('../app')) |
| 26 | .inDir(testPath) |
| 27 | .withOptions({ 'skip-install': true }) |
| 28 | .withPrompts({ |
| 29 | name: 'test-name', |
| 30 | host: 'test-host', |
| 31 | token: 'test-token', |
| 32 | session: 'test-session' |
| 33 | }); |
| 34 | }); |
| 35 | |
| 36 | describe('default settings', function () { |
| 37 | beforeEach(function (done) { |
| 38 | this.generator.on('end', done); |
| 39 | }); |
| 40 | |
| 41 | it('generate base files', function () { |
| 42 | assert.file(getDefaultFiles()); |
| 43 | }); |
| 44 | }); |
| 45 | }); |