From 4648877d0365103a9c88179bf23ec3a9f7c57fc8 Mon Sep 17 00:00:00 2001 From: Jeroen Vinke Date: Thu, 19 Jul 2018 11:22:50 +0200 Subject: [PATCH] feat(requirejs/systemjs): add protractor and jest support --- .../cli/integration-test-runner/none.js | 4 + .../cli/integration-test-runner/protractor.js | 5 + .../cli/unit-test-runners/jest.js | 5 + .../cli/unit-test-runners/karma.js | 12 ++- .../general/integration-test-runner/none.js | 4 + .../integration-test-runner/protractor.js | 40 +++++++ .../unit-test-runners/jasmine.js | 7 +- .../general/unit-test-runners/jest.js | 1 - .../integration-test-runner/protractor.js | 30 +----- .../webpack/unit-test-runners/jest.js | 100 +----------------- lib/commands/new/new-application.json | 42 +------- lib/dependencies.json | 1 + lib/resources/tasks/protractor.js | 16 +++ lib/resources/tasks/protractor.json | 4 + lib/resources/tasks/protractor.ts | 16 +++ .../test/{webpack/babel => }/e2e/demo.e2e.js | 2 +- .../{webpack/typescript => }/e2e/demo.e2e.ts | 2 +- .../{webpack/babel => }/e2e/skeleton.po.js | 0 .../typescript => }/e2e/skeleton.po.ts | 0 .../{webpack/babel => }/e2e/welcome.po.js | 0 .../typescript => }/e2e/welcome.po.ts | 0 .../test/{webpack/babel => }/jest-pretest.js | 0 .../{webpack/typescript => }/jest-pretest.ts | 0 ...actor.conf.js => protractor.babel.conf.js} | 6 +- ....conf.js => protractor.typescript.conf.js} | 5 +- .../test/{webpack/babel => }/unit/.eslintrc | 0 lib/resources/test/{ => unit}/app.spec.js | 0 .../{webpack/typescript => }/unit/app.spec.ts | 0 .../unit/__snapshots__/welcome.spec.js.snap | 24 ----- .../test/webpack/babel/unit/app.spec.js | 7 -- .../unit/__snapshots__/welcome.spec.ts.snap | 24 ----- lib/workflow/activities/project-create.js | 4 + 32 files changed, 118 insertions(+), 243 deletions(-) create mode 100644 lib/commands/new/buildsystems/cli/integration-test-runner/none.js create mode 100644 lib/commands/new/buildsystems/cli/integration-test-runner/protractor.js create mode 100644 lib/commands/new/buildsystems/cli/unit-test-runners/jest.js create mode 100644 lib/commands/new/buildsystems/general/integration-test-runner/none.js create mode 100644 lib/commands/new/buildsystems/general/integration-test-runner/protractor.js rename lib/commands/new/buildsystems/{webpack => general}/unit-test-runners/jasmine.js (61%) create mode 100644 lib/resources/tasks/protractor.js create mode 100644 lib/resources/tasks/protractor.json create mode 100644 lib/resources/tasks/protractor.ts rename lib/resources/test/{webpack/babel => }/e2e/demo.e2e.js (87%) rename lib/resources/test/{webpack/typescript => }/e2e/demo.e2e.ts (89%) rename lib/resources/test/{webpack/babel => }/e2e/skeleton.po.js (100%) rename lib/resources/test/{webpack/typescript => }/e2e/skeleton.po.ts (100%) rename lib/resources/test/{webpack/babel => }/e2e/welcome.po.js (100%) rename lib/resources/test/{webpack/typescript => }/e2e/welcome.po.ts (100%) rename lib/resources/test/{webpack/babel => }/jest-pretest.js (100%) rename lib/resources/test/{webpack/typescript => }/jest-pretest.ts (100%) rename lib/resources/test/{webpack/babel/protractor.conf.js => protractor.babel.conf.js} (89%) rename lib/resources/test/{webpack/typescript/protractor.conf.js => protractor.typescript.conf.js} (91%) rename lib/resources/test/{webpack/babel => }/unit/.eslintrc (100%) rename lib/resources/test/{ => unit}/app.spec.js (100%) rename lib/resources/test/{webpack/typescript => }/unit/app.spec.ts (100%) delete mode 100644 lib/resources/test/webpack/babel/unit/__snapshots__/welcome.spec.js.snap delete mode 100644 lib/resources/test/webpack/babel/unit/app.spec.js delete mode 100644 lib/resources/test/webpack/typescript/unit/__snapshots__/welcome.spec.ts.snap diff --git a/lib/commands/new/buildsystems/cli/integration-test-runner/none.js b/lib/commands/new/buildsystems/cli/integration-test-runner/none.js new file mode 100644 index 000000000..24a3553b7 --- /dev/null +++ b/lib/commands/new/buildsystems/cli/integration-test-runner/none.js @@ -0,0 +1,4 @@ +'use strict'; + +module.exports = function(project) { +}; diff --git a/lib/commands/new/buildsystems/cli/integration-test-runner/protractor.js b/lib/commands/new/buildsystems/cli/integration-test-runner/protractor.js new file mode 100644 index 000000000..978f637aa --- /dev/null +++ b/lib/commands/new/buildsystems/cli/integration-test-runner/protractor.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function(project) { + require('../../general/integration-test-runner/protractor')(project); +}; diff --git a/lib/commands/new/buildsystems/cli/unit-test-runners/jest.js b/lib/commands/new/buildsystems/cli/unit-test-runners/jest.js new file mode 100644 index 000000000..75d98b304 --- /dev/null +++ b/lib/commands/new/buildsystems/cli/unit-test-runners/jest.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function(project) { + require('../../general/unit-test-runners/jest')(project); +}; diff --git a/lib/commands/new/buildsystems/cli/unit-test-runners/karma.js b/lib/commands/new/buildsystems/cli/unit-test-runners/karma.js index cc3a78304..7edd37a10 100644 --- a/lib/commands/new/buildsystems/cli/unit-test-runners/karma.js +++ b/lib/commands/new/buildsystems/cli/unit-test-runners/karma.js @@ -13,10 +13,7 @@ module.exports = function(project) { ).addToContent( ProjectItem.resource('karma.conf.js', 'content/karma.conf.ext', project.model.transpiler), project.tests.add( - project.unitTests.add( - ProjectItem.resource('setup.ext', 'test/setup.js', project.model.transpiler), - ProjectItem.resource('app.spec.ext', 'test/app.spec.js', project.model.transpiler) - ), + ProjectItem.resource('setup.ext', 'test/setup.js', project.model.transpiler), ProjectItem.resource('aurelia-karma.js', `test/${project.model.loader.id}.aurelia-karma.js`) ) ).addToDevDependencies( @@ -30,6 +27,11 @@ module.exports = function(project) { if (project.model.transpiler.id === 'babel') { project.addToDevDependencies('karma-babel-preprocessor'); } else { - project.addToDevDependencies('karma-typescript-preprocessor', '@types/jasmine'); + project.addToDevDependencies('karma-typescript-preprocessor'); + + // prevent duplicate typescript definitions + if (!project.model.unitTestRunners.find(x => x.id === 'jest')) { + project.addToDevDependencies('@types/jasmine'); + } } }; diff --git a/lib/commands/new/buildsystems/general/integration-test-runner/none.js b/lib/commands/new/buildsystems/general/integration-test-runner/none.js new file mode 100644 index 000000000..24a3553b7 --- /dev/null +++ b/lib/commands/new/buildsystems/general/integration-test-runner/none.js @@ -0,0 +1,4 @@ +'use strict'; + +module.exports = function(project) { +}; diff --git a/lib/commands/new/buildsystems/general/integration-test-runner/protractor.js b/lib/commands/new/buildsystems/general/integration-test-runner/protractor.js new file mode 100644 index 000000000..593583824 --- /dev/null +++ b/lib/commands/new/buildsystems/general/integration-test-runner/protractor.js @@ -0,0 +1,40 @@ +'use strict'; +const ProjectItem = require('../../../../../project-item').ProjectItem; + +module.exports = function(project) { + let configPath; + + if (project.model.transpiler.id === 'typescript') { + project.addToDevDependencies( + 'ts-node' + ); + + // prevent duplicate typescript definitions + if (!project.model.unitTestRunners.find(x => x.id === 'jest')) { + project.addToDevDependencies('@types/jasmine'); + } + + configPath = 'test/protractor.typescript.conf.js'; + } else if (project.model.transpiler.id === 'babel') { + configPath = 'test/protractor.babel.conf.js'; + } + + project.addToTasks( + ProjectItem.resource('protractor.ext', 'tasks/protractor.ext', project.model.transpiler), + ProjectItem.resource('protractor.json', 'tasks/protractor.json') + ).addToDevDependencies( + 'aurelia-protractor-plugin', + 'protractor', + 'gulp-protractor', + 'wait-on' + ).addToContent( + project.tests.add( + project.e2eTests.add( + ProjectItem.resource('demo.e2e.ext', 'test/e2e/demo.e2e.ext', project.model.transpiler), + ProjectItem.resource('skeleton.po.ext', 'test/e2e/skeleton.po.ext', project.model.transpiler), + ProjectItem.resource('welcome.po.ext', 'test/e2e/welcome.po.ext', project.model.transpiler) + ), + ProjectItem.resource('protractor.conf.js', configPath) + ) + ); +}; diff --git a/lib/commands/new/buildsystems/webpack/unit-test-runners/jasmine.js b/lib/commands/new/buildsystems/general/unit-test-runners/jasmine.js similarity index 61% rename from lib/commands/new/buildsystems/webpack/unit-test-runners/jasmine.js rename to lib/commands/new/buildsystems/general/unit-test-runners/jasmine.js index e6426a1d3..e55f64446 100644 --- a/lib/commands/new/buildsystems/webpack/unit-test-runners/jasmine.js +++ b/lib/commands/new/buildsystems/general/unit-test-runners/jasmine.js @@ -7,13 +7,10 @@ module.exports = function(project) { 'displayName': 'Jasmine' }; - let transpilerId = project.model.transpiler.id; - let testContentRoot = `test/webpack/${transpilerId}`; - project.addToContent( project.tests.add( project.unitTests.add( - ProjectItem.resource('app.spec.ext', `${testContentRoot}/unit/app.spec.ext`, project.model.transpiler) + ProjectItem.resource('app.spec.ext', 'test/unit/app.spec.ext', project.model.transpiler) ) ) ); @@ -22,7 +19,7 @@ module.exports = function(project) { project.addToContent( project.tests.add( project.unitTests.add( - ProjectItem.resource('.eslintrc', `${testContentRoot}/unit/.eslintrc`) + ProjectItem.resource('.eslintrc', 'test/unit/.eslintrc') ) ) ); diff --git a/lib/commands/new/buildsystems/general/unit-test-runners/jest.js b/lib/commands/new/buildsystems/general/unit-test-runners/jest.js index 97f215080..4409c8c62 100644 --- a/lib/commands/new/buildsystems/general/unit-test-runners/jest.js +++ b/lib/commands/new/buildsystems/general/unit-test-runners/jest.js @@ -15,7 +15,6 @@ module.exports = function(project) { ).addToDevDependencies( 'jest', 'jest-cli', - 'gulp-util', 'plugin-error', 'aurelia-loader-nodejs', 'aurelia-pal-nodejs' diff --git a/lib/commands/new/buildsystems/webpack/integration-test-runner/protractor.js b/lib/commands/new/buildsystems/webpack/integration-test-runner/protractor.js index 3c0c1e0f5..978f637aa 100644 --- a/lib/commands/new/buildsystems/webpack/integration-test-runner/protractor.js +++ b/lib/commands/new/buildsystems/webpack/integration-test-runner/protractor.js @@ -1,33 +1,5 @@ 'use strict'; -const ProjectItem = require('../../../../../project-item').ProjectItem; module.exports = function(project) { - let transpilerId = project.model.transpiler.id; - let testContentRoot = `test/webpack/${transpilerId}`; - - if (project.model.transpiler.id === 'babel') { - project.addToDevDependencies( - 'ts-node' - ); - } - - project.addToDevDependencies( - 'aurelia-protractor-plugin', - 'protractor', - 'wait-on' - ).addToContent( - project.tests.add( - project.e2eTests.add( - ProjectItem.resource('demo.e2e.ext', `${testContentRoot}/e2e/demo.e2e.ext`, project.model.transpiler), - ProjectItem.resource('skeleton.po.ext', `${testContentRoot}/e2e/skeleton.po.ext`, project.model.transpiler), - ProjectItem.resource('welcome.po.ext', `${testContentRoot}/e2e/welcome.po.ext`, project.model.transpiler) - ), - ProjectItem.resource('protractor.conf.js', `${testContentRoot}/protractor.conf.js`) - ) - ); - - // prevent duplicate typescript definitions - if (!project.model.unitTestRunner.find(x => x.id === 'jest')) { - project.addToDevDependencies('@types/jasmine'); - } + require('../../general/integration-test-runner/protractor')(project); }; diff --git a/lib/commands/new/buildsystems/webpack/unit-test-runners/jest.js b/lib/commands/new/buildsystems/webpack/unit-test-runners/jest.js index e45fc4a00..75d98b304 100644 --- a/lib/commands/new/buildsystems/webpack/unit-test-runners/jest.js +++ b/lib/commands/new/buildsystems/webpack/unit-test-runners/jest.js @@ -1,103 +1,5 @@ 'use strict'; -const ProjectItem = require('../../../../../project-item').ProjectItem; module.exports = function(project) { - let configureJasmine = require('./jasmine'); - configureJasmine(project); - - let transpilerId = project.model.transpiler.id; - let testContentRoot = `test/webpack/${transpilerId}`; - - project.addToTasks( - ProjectItem.resource('jest.ext', 'tasks/jest.ext', project.model.transpiler), - ProjectItem.resource('jest.json', 'tasks/jest.json') - ).addToContent( - project.tests.add( - ProjectItem.resource('jest-pretest.ext', `${testContentRoot}/jest-pretest.ext`, project.model.transpiler) - ) - ).addToDevDependencies( - 'jest', - 'jest-cli', - 'plugin-error', - 'aurelia-loader-nodejs', - 'aurelia-pal-nodejs' - ); - - if (project.model.transpiler.id === 'babel') { - project.addToDevDependencies( - 'babel-jest' - ); - - project.package.jest = { - modulePaths: [ - '/src', - '/node_modules' - ], - moduleFileExtensions: [ - 'js', - 'json' - ], - transform: { - '^.+\\.jsx?$': 'babel-jest' - }, - testRegex: '\\.spec\\.(ts|js)x?$', - setupFiles: [ - '/test/jest-pretest.js' - ], - testEnvironment: 'node', - collectCoverage: true, - collectCoverageFrom: [ - 'src/**/*.{js,ts}', - '!**/*.spec.{js,ts}', - '!**/node_modules/**', - '!**/test/**' - ], - coverageDirectory: '/test/coverage-jest', - coverageReporters: [ - 'json', - 'lcov', - 'text', - 'html' - ] - }; - } else if (project.model.transpiler.id === 'typescript') { - project.addToDevDependencies( - 'ts-jest', - '@types/jest' - ); - - project.package.jest = { - modulePaths: [ - '/src', - '/node_modules' - ], - moduleFileExtensions: [ - 'js', - 'json', - 'ts' - ], - transform: { - '^.+\\.(ts|tsx)$': '/node_modules/ts-jest/preprocessor.js' - }, - testRegex: '\\.spec\\.(ts|js)x?$', - setupFiles: [ - '/test/jest-pretest.ts' - ], - testEnvironment: 'node', - collectCoverage: true, - collectCoverageFrom: [ - 'src/**/*.{js,ts}', - '!**/*.spec.{js,ts}', - '!**/node_modules/**', - '!**/test/**' - ], - coverageDirectory: '/test/coverage-jest', - coverageReporters: [ - 'json', - 'lcov', - 'text', - 'html' - ] - }; - } + require('../../general/unit-test-runners/jest')(project); }; diff --git a/lib/commands/new/new-application.json b/lib/commands/new/new-application.json index 8d02bfe7b..8a7ced904 100644 --- a/lib/commands/new/new-application.json +++ b/lib/commands/new/new-application.json @@ -352,7 +352,7 @@ { "id": 650, "type": "input-select", - "nextActivity": 660, + "nextActivity": 680, "question": "What css processor would you like to use?", "stateProperty": "cssProcessor", "options": [ @@ -403,46 +403,6 @@ } ] }, - { - "type": "branch-switch", - "id": 660, - "stateProperty": "bundler", - "branches": [ - { - "case": "cli", - "nextActivity": 670 - }, - { - "case": "webpack", - "nextActivity": 680 - } - ] - }, - { - "id": 670, - "type": "input-select", - "nextActivity": 700, - "question": "Would you like to configure unit testing?", - "stateProperty": "unitTestRunner", - "options": [ - { - "displayName": "Yes", - "description": "Configure your app with Jasmine and Karma.", - "value": { - "id": "karma", - "displayName": "Karma" - } - }, - { - "displayName": "No", - "description": "Skip testing. My code is always perfect anyway.", - "value": { - "id": "none", - "displayName": "None" - } - } - ] - }, { "id": 680, "type": "input-multiselect", diff --git a/lib/dependencies.json b/lib/dependencies.json index e5d156501..d93343e02 100644 --- a/lib/dependencies.json +++ b/lib/dependencies.json @@ -54,6 +54,7 @@ "gulp-notify": "^3.2.0", "gulp-plumber": "^1.2.0", "gulp-postcss": "^7.0.1", + "gulp-protractor": "^4.1.0", "gulp-rename": "^1.2.2", "gulp-sass": "^3.1.0", "gulp-sourcemaps": "^2.6.4", diff --git a/lib/resources/tasks/protractor.js b/lib/resources/tasks/protractor.js new file mode 100644 index 000000000..b382b8488 --- /dev/null +++ b/lib/resources/tasks/protractor.js @@ -0,0 +1,16 @@ +import gulp from 'gulp'; +const {protractor, webdriver_update } = require('gulp-protractor'); + +gulp.task('webdriver_update', webdriver_update); + +gulp.task('protractor', (cb) => { + gulp.src(['test/e2e/**/*.e2e.js'], { read: false }).pipe(protractor({ + configFile: 'test/protractor.conf.js' + })).on('end', cb); +}); + +// Setting up the test task +export default gulp.series( + 'webdriver_update', + 'protractor' +); diff --git a/lib/resources/tasks/protractor.json b/lib/resources/tasks/protractor.json new file mode 100644 index 000000000..9d873a9f7 --- /dev/null +++ b/lib/resources/tasks/protractor.json @@ -0,0 +1,4 @@ +{ + "name": "protractor", + "description": "Runs Protractor and reports the results. Start the application before running this task." +} diff --git a/lib/resources/tasks/protractor.ts b/lib/resources/tasks/protractor.ts new file mode 100644 index 000000000..1308eaa37 --- /dev/null +++ b/lib/resources/tasks/protractor.ts @@ -0,0 +1,16 @@ +import * as gulp from 'gulp'; +const {protractor, webdriver_update } = require('gulp-protractor'); + +gulp.task('webdriver_update', webdriver_update); + +gulp.task('protractor', (cb) => { + gulp.src(['test/e2e/**/*.e2e.ts'], { read: false }).pipe(protractor({ + configFile: 'test/protractor.conf.js' + })).on('end', cb); +}); + +// Setting up the test task +export default gulp.series( + 'webdriver_update', + 'protractor' +); diff --git a/lib/resources/test/webpack/babel/e2e/demo.e2e.js b/lib/resources/test/e2e/demo.e2e.js similarity index 87% rename from lib/resources/test/webpack/babel/e2e/demo.e2e.js rename to lib/resources/test/e2e/demo.e2e.js index f2055dfdf..a816036da 100644 --- a/lib/resources/test/webpack/babel/e2e/demo.e2e.js +++ b/lib/resources/test/e2e/demo.e2e.js @@ -14,7 +14,7 @@ describe('aurelia skeleton app', function() { }); it('should load the page and display the initial page title', async () => { - await expect(await poSkeleton.getCurrentPageTitle()).toBe('Aurelia Navigation Skeleton'); + await expect(await poSkeleton.getCurrentPageTitle()).toContain('Aurelia'); }); it('should display greeting', async () => { diff --git a/lib/resources/test/webpack/typescript/e2e/demo.e2e.ts b/lib/resources/test/e2e/demo.e2e.ts similarity index 89% rename from lib/resources/test/webpack/typescript/e2e/demo.e2e.ts rename to lib/resources/test/e2e/demo.e2e.ts index 499e2d15b..49b23dad0 100644 --- a/lib/resources/test/webpack/typescript/e2e/demo.e2e.ts +++ b/lib/resources/test/e2e/demo.e2e.ts @@ -15,7 +15,7 @@ describe('aurelia skeleton app', function() { }); it('should load the page and display the initial page title', async () => { - await expect(await poSkeleton.getCurrentPageTitle()).toBe('Aurelia Navigation Skeleton'); + await expect(await poSkeleton.getCurrentPageTitle()).toContain('Aurelia'); }); it('should display greeting', async () => { diff --git a/lib/resources/test/webpack/babel/e2e/skeleton.po.js b/lib/resources/test/e2e/skeleton.po.js similarity index 100% rename from lib/resources/test/webpack/babel/e2e/skeleton.po.js rename to lib/resources/test/e2e/skeleton.po.js diff --git a/lib/resources/test/webpack/typescript/e2e/skeleton.po.ts b/lib/resources/test/e2e/skeleton.po.ts similarity index 100% rename from lib/resources/test/webpack/typescript/e2e/skeleton.po.ts rename to lib/resources/test/e2e/skeleton.po.ts diff --git a/lib/resources/test/webpack/babel/e2e/welcome.po.js b/lib/resources/test/e2e/welcome.po.js similarity index 100% rename from lib/resources/test/webpack/babel/e2e/welcome.po.js rename to lib/resources/test/e2e/welcome.po.js diff --git a/lib/resources/test/webpack/typescript/e2e/welcome.po.ts b/lib/resources/test/e2e/welcome.po.ts similarity index 100% rename from lib/resources/test/webpack/typescript/e2e/welcome.po.ts rename to lib/resources/test/e2e/welcome.po.ts diff --git a/lib/resources/test/webpack/babel/jest-pretest.js b/lib/resources/test/jest-pretest.js similarity index 100% rename from lib/resources/test/webpack/babel/jest-pretest.js rename to lib/resources/test/jest-pretest.js diff --git a/lib/resources/test/webpack/typescript/jest-pretest.ts b/lib/resources/test/jest-pretest.ts similarity index 100% rename from lib/resources/test/webpack/typescript/jest-pretest.ts rename to lib/resources/test/jest-pretest.ts diff --git a/lib/resources/test/webpack/babel/protractor.conf.js b/lib/resources/test/protractor.babel.conf.js similarity index 89% rename from lib/resources/test/webpack/babel/protractor.conf.js rename to lib/resources/test/protractor.babel.conf.js index 5b36fb287..ba9c0b651 100644 --- a/lib/resources/test/webpack/babel/protractor.conf.js +++ b/lib/resources/test/protractor.babel.conf.js @@ -1,12 +1,11 @@ -const port = 19876; +const aureliaConfig = require('../aurelia_project/aurelia.json'); +const port = aureliaConfig.platform.port; exports.config = { port: port, baseUrl: `http://localhost:${port}/`, - // use `npm start -- e2e` - specs: [ '**/*.e2e.js' ], @@ -53,6 +52,7 @@ exports.config = { onPrepare: function() { process.env.BABEL_TARGET = 'node'; process.env.IN_PROTRACTOR = 'true'; + require('babel-polyfill'); require('babel-register'); }, diff --git a/lib/resources/test/webpack/typescript/protractor.conf.js b/lib/resources/test/protractor.typescript.conf.js similarity index 91% rename from lib/resources/test/webpack/typescript/protractor.conf.js rename to lib/resources/test/protractor.typescript.conf.js index 915cb4a60..0288395ec 100644 --- a/lib/resources/test/webpack/typescript/protractor.conf.js +++ b/lib/resources/test/protractor.typescript.conf.js @@ -1,12 +1,11 @@ -const port = 19876; +const aureliaConfig = require('../aurelia_project/aurelia.json'); +const port = aureliaConfig.platform.port; exports.config = { port: port, baseUrl: `http://localhost:${port}/`, - // use `npm start -- e2e` - specs: [ '**/*.e2e.ts' ], diff --git a/lib/resources/test/webpack/babel/unit/.eslintrc b/lib/resources/test/unit/.eslintrc similarity index 100% rename from lib/resources/test/webpack/babel/unit/.eslintrc rename to lib/resources/test/unit/.eslintrc diff --git a/lib/resources/test/app.spec.js b/lib/resources/test/unit/app.spec.js similarity index 100% rename from lib/resources/test/app.spec.js rename to lib/resources/test/unit/app.spec.js diff --git a/lib/resources/test/webpack/typescript/unit/app.spec.ts b/lib/resources/test/unit/app.spec.ts similarity index 100% rename from lib/resources/test/webpack/typescript/unit/app.spec.ts rename to lib/resources/test/unit/app.spec.ts diff --git a/lib/resources/test/webpack/babel/unit/__snapshots__/welcome.spec.js.snap b/lib/resources/test/webpack/babel/unit/__snapshots__/welcome.spec.js.snap deleted file mode 100644 index f5c774b61..000000000 --- a/lib/resources/test/webpack/babel/unit/__snapshots__/welcome.spec.js.snap +++ /dev/null @@ -1,24 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`WelcomeComponent should render correctly 1`] = ` -"
-
-

Welcome to the Aurelia Navigation App

-
-
- - -
-
- - -
-
- -

JOHN DOE

-
- -
-
-
" -`; diff --git a/lib/resources/test/webpack/babel/unit/app.spec.js b/lib/resources/test/webpack/babel/unit/app.spec.js deleted file mode 100644 index 500fdb5bd..000000000 --- a/lib/resources/test/webpack/babel/unit/app.spec.js +++ /dev/null @@ -1,7 +0,0 @@ -import {App} from '../../src/app'; - -describe('the app', () => { - it('says hello', () => { - expect(new App().message).toBe('Hello World!'); - }); -}); diff --git a/lib/resources/test/webpack/typescript/unit/__snapshots__/welcome.spec.ts.snap b/lib/resources/test/webpack/typescript/unit/__snapshots__/welcome.spec.ts.snap deleted file mode 100644 index f5c774b61..000000000 --- a/lib/resources/test/webpack/typescript/unit/__snapshots__/welcome.spec.ts.snap +++ /dev/null @@ -1,24 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`WelcomeComponent should render correctly 1`] = ` -"
-
-

Welcome to the Aurelia Navigation App

-
-
- - -
-
- - -
-
- -

JOHN DOE

-
- -
-
-
" -`; diff --git a/lib/workflow/activities/project-create.js b/lib/workflow/activities/project-create.js index 5529d6dc1..09ab2b18f 100644 --- a/lib/workflow/activities/project-create.js +++ b/lib/workflow/activities/project-create.js @@ -39,6 +39,10 @@ module.exports = class { let project = context.state.project = new ProjectTemplate(model, this.options, this.ui); + if (this.options.hasFlag('print-model')) { + this.ui.log(JSON.stringify(model, null, 2)); + } + return this.ui.log(this.createProjectDescription(model)) .then(() => this.projectConfirmation(project)) .then(answer => {