From 995c155439b8ddf7b1704be764260fb9a5d5c62a Mon Sep 17 00:00:00 2001 From: Ben Limmer Date: Tue, 30 Aug 2016 17:55:36 -0600 Subject: [PATCH 1/4] Fix tests. Test selectors were not marked to be removed in test, breaking the build. --- ember-cli-build.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ember-cli-build.js b/ember-cli-build.js index 70ef299a..b0f5b4cc 100644 --- a/ember-cli-build.js +++ b/ember-cli-build.js @@ -5,7 +5,9 @@ var StripTestSelectorsTransform = require('./strip-test-selectors'); module.exports = function(defaults) { var app = new EmberAddon(defaults, { - // Add options here + 'ember-test-selectors': { + environments: ['test'] + } }); // add the StripTestSelectorsTransform to the registry, so the dummy app has From 9b957f5550838e9596d1bb9d2c22fda3b0d440a8 Mon Sep 17 00:00:00 2001 From: Ben Limmer Date: Tue, 30 Aug 2016 17:56:10 -0600 Subject: [PATCH 2/4] Provide a simple caching strategy. This silences the deprecation warning reported in #19. I found this solution [here](https://github.com/ember-animation/liquid-fire/issues/485) --- ember-cli-build.js | 3 ++- index.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ember-cli-build.js b/ember-cli-build.js index b0f5b4cc..bc7ba562 100644 --- a/ember-cli-build.js +++ b/ember-cli-build.js @@ -15,7 +15,8 @@ module.exports = function(defaults) { // therefore stripped app.registry.add('htmlbars-ast-plugin', { name: 'strip-test-selectors', - plugin: StripTestSelectorsTransform + plugin: StripTestSelectorsTransform, + baseDir: function() { return __dirname; } }); return app.toTree(); diff --git a/index.js b/index.js index 30fadc76..aa2b75bf 100644 --- a/index.js +++ b/index.js @@ -14,7 +14,8 @@ module.exports = { registry.add('htmlbars-ast-plugin', { name: 'strip-test-selectors', - plugin: StripTestSelectorsTransform + plugin: StripTestSelectorsTransform, + baseDir: function() { return __dirname; } }); } } From e184ca4d88f73a44557d03d25f6766be11bab81a Mon Sep 17 00:00:00 2001 From: Ben Limmer Date: Tue, 30 Aug 2016 18:03:55 -0600 Subject: [PATCH 3/4] Upgrade to Ember CLI 2.7 --- .editorconfig | 14 ------- .jshintrc | 2 +- .npmignore | 20 +++++----- bower.json | 13 ++----- config/ember-try.js | 54 ++++++++++++++------------ package.json | 27 ++++++------- testem.json => testem.js | 5 ++- tests/.jshintrc | 2 +- tests/dummy/app/app.js | 2 +- tests/dummy/app/index.html | 8 ++-- tests/dummy/app/router.js | 3 +- tests/dummy/config/environment.js | 3 +- tests/helpers/module-for-acceptance.js | 12 +++--- tests/index.html | 17 ++++---- 14 files changed, 84 insertions(+), 98 deletions(-) rename testem.json => testem.js (81%) diff --git a/.editorconfig b/.editorconfig index 47c54384..219985c2 100644 --- a/.editorconfig +++ b/.editorconfig @@ -13,22 +13,8 @@ insert_final_newline = true indent_style = space indent_size = 2 -[*.js] -indent_style = space -indent_size = 2 - [*.hbs] insert_final_newline = false -indent_style = space -indent_size = 2 - -[*.css] -indent_style = space -indent_size = 2 - -[*.html] -indent_style = space -indent_size = 2 [*.{diff,md}] trim_trailing_whitespace = false diff --git a/.jshintrc b/.jshintrc index 08096eff..d421faa3 100644 --- a/.jshintrc +++ b/.jshintrc @@ -27,6 +27,6 @@ "strict": false, "white": false, "eqnull": true, - "esnext": true, + "esversion": 6, "unused": true } diff --git a/.npmignore b/.npmignore index 49996f5a..fa8b147a 100644 --- a/.npmignore +++ b/.npmignore @@ -1,14 +1,16 @@ -bower_components/ -tests/ -tmp/ -dist/ - +/bower_components +/config/ember-try.js +/dist +/tests +/tmp +**/.gitkeep .bowerrc .editorconfig .ember-cli +.gitignore +.jshintrc +.watchmanconfig .travis.yml -.npmignore -**/.gitkeep bower.json -Brocfile.js -testem.json +ember-cli-build.js +testem.js diff --git a/bower.json b/bower.json index d1e8f298..eb62383d 100644 --- a/bower.json +++ b/bower.json @@ -1,15 +1,8 @@ { "name": "ember-test-selectors", "dependencies": { - "ember": "2.3.0", - "ember-cli-shims": "0.1.0", - "ember-cli-test-loader": "0.2.2", - "ember-load-initializers": "0.1.7", - "ember-qunit-notifications": "0.1.0", - "jquery": "1.11.3", - "loader.js": "^3.5.0" - }, - "resolutions": { - "ember": "2.2.0" + "ember": "~2.7.0", + "ember-cli-shims": "0.1.1", + "ember-qunit-notifications": "0.1.0" } } diff --git a/config/ember-try.js b/config/ember-try.js index 910cf9ad..2743c3b5 100644 --- a/config/ember-try.js +++ b/config/ember-try.js @@ -2,43 +2,47 @@ module.exports = { scenarios: [ { - name: 'default', - dependencies: { } - }, - { - name: 'ember-1-13', - dependencies: { - 'ember': 'components/ember#1.13' - }, - resolutions: { - 'ember': '1.13' + name: 'ember-1.13', + bower: { + dependencies: { + 'ember': '~1.13.0' + }, + resolutions: { + 'ember': '~1.13.0' + } } }, { name: 'ember-release', - dependencies: { - 'ember': 'components/ember#release' - }, - resolutions: { - 'ember': 'release' + bower: { + dependencies: { + 'ember': 'components/ember#release' + }, + resolutions: { + 'ember': 'release' + } } }, { name: 'ember-beta', - dependencies: { - 'ember': 'components/ember#beta' - }, - resolutions: { - 'ember': 'beta' + bower: { + dependencies: { + 'ember': 'components/ember#beta' + }, + resolutions: { + 'ember': 'beta' + } } }, { name: 'ember-canary', - dependencies: { - 'ember': 'components/ember#canary' - }, - resolutions: { - 'ember': 'canary' + bower: { + dependencies: { + 'ember': 'components/ember#canary' + }, + resolutions: { + 'ember': 'canary' + } } } ] diff --git a/package.json b/package.json index 370280c2..15e3e956 100644 --- a/package.json +++ b/package.json @@ -17,24 +17,25 @@ "author": "", "license": "MIT", "devDependencies": { - "broccoli-asset-rev": "^2.2.0", - "ember-ajax": "0.7.1", - "ember-cli": "2.3.0-beta.1", + "broccoli-asset-rev": "^2.4.2", + "ember-ajax": "^2.0.1", + "ember-cli": "2.7.0", "ember-cli-app-version": "^1.0.0", "ember-cli-dependency-checker": "^1.2.0", - "ember-cli-htmlbars": "^1.0.1", + "ember-cli-htmlbars": "^1.0.3", "ember-cli-htmlbars-inline-precompile": "^0.3.1", - "ember-cli-inject-live-reload": "^1.3.1", - "ember-cli-qunit": "^1.2.1", - "ember-cli-release": "0.2.8", - "ember-cli-sri": "^2.0.0", + "ember-cli-inject-live-reload": "^1.4.0", + "ember-cli-jshint": "^1.0.0", + "ember-cli-qunit": "^2.0.0", + "ember-cli-release": "^0.2.9", + "ember-cli-sri": "^2.1.0", + "ember-cli-test-loader": "^1.1.0", "ember-cli-uglify": "^1.2.0", - "ember-data": "^2.3.0", - "ember-disable-prototype-extensions": "^1.0.0", - "ember-disable-proxy-controllers": "^1.0.1", - "ember-export-application-global": "^1.0.4", + "ember-data": "^2.7.0", + "ember-disable-prototype-extensions": "^1.1.0", + "ember-export-application-global": "^1.0.5", "ember-resolver": "^2.0.3", - "ember-try": "~0.0.8", + "loader.js": "^4.0.1", "mocha": "^1.21.4", "mocha-jshint": "^2.3.1" }, diff --git a/testem.json b/testem.js similarity index 81% rename from testem.json rename to testem.js index 0f35392c..26044b2f 100644 --- a/testem.json +++ b/testem.js @@ -1,4 +1,5 @@ -{ +/*jshint node:true*/ +module.exports = { "framework": "qunit", "test_page": "tests/index.html?hidepassed", "disable_watching": true, @@ -9,4 +10,4 @@ "PhantomJS", "Chrome" ] -} +}; diff --git a/tests/.jshintrc b/tests/.jshintrc index 6ec0b7c1..d2bd1134 100644 --- a/tests/.jshintrc +++ b/tests/.jshintrc @@ -47,6 +47,6 @@ "strict": false, "white": false, "eqnull": true, - "esnext": true, + "esversion": 6, "unused": true } diff --git a/tests/dummy/app/app.js b/tests/dummy/app/app.js index d8e5c713..831ad610 100644 --- a/tests/dummy/app/app.js +++ b/tests/dummy/app/app.js @@ -1,6 +1,6 @@ import Ember from 'ember'; import Resolver from './resolver'; -import loadInitializers from 'ember/load-initializers'; +import loadInitializers from 'ember-load-initializers'; import config from './config/environment'; let App; diff --git a/tests/dummy/app/index.html b/tests/dummy/app/index.html index c9b43270..5120bd73 100644 --- a/tests/dummy/app/index.html +++ b/tests/dummy/app/index.html @@ -9,16 +9,16 @@ {{content-for "head"}} - - + + {{content-for "head-footer"}} {{content-for "body"}} - - + + {{content-for "body-footer"}} diff --git a/tests/dummy/app/router.js b/tests/dummy/app/router.js index 3bba78eb..cdc25787 100644 --- a/tests/dummy/app/router.js +++ b/tests/dummy/app/router.js @@ -2,7 +2,8 @@ import Ember from 'ember'; import config from './config/environment'; const Router = Ember.Router.extend({ - location: config.locationType + location: config.locationType, + rootURL: config.rootURL }); Router.map(function() { diff --git a/tests/dummy/config/environment.js b/tests/dummy/config/environment.js index c59bcd53..2529939c 100644 --- a/tests/dummy/config/environment.js +++ b/tests/dummy/config/environment.js @@ -4,7 +4,7 @@ module.exports = function(environment) { var ENV = { modulePrefix: 'dummy', environment: environment, - baseURL: '/', + rootURL: '/', locationType: 'auto', EmberENV: { FEATURES: { @@ -29,7 +29,6 @@ module.exports = function(environment) { if (environment === 'test') { // Testem prefers this... - ENV.baseURL = '/'; ENV.locationType = 'none'; // keep test console output quieter diff --git a/tests/helpers/module-for-acceptance.js b/tests/helpers/module-for-acceptance.js index ed23003d..76996fd0 100644 --- a/tests/helpers/module-for-acceptance.js +++ b/tests/helpers/module-for-acceptance.js @@ -1,23 +1,23 @@ import { module } from 'qunit'; +import Ember from 'ember'; import startApp from '../helpers/start-app'; import destroyApp from '../helpers/destroy-app'; +const { RSVP: { Promise } } = Ember; + export default function(name, options = {}) { module(name, { beforeEach() { this.application = startApp(); if (options.beforeEach) { - options.beforeEach.apply(this, arguments); + return options.beforeEach.apply(this, arguments); } }, afterEach() { - destroyApp(this.application); - - if (options.afterEach) { - options.afterEach.apply(this, arguments); - } + let afterEach = options.afterEach && options.afterEach.apply(this, arguments); + return Promise.resolve(afterEach).then(() => destroyApp(this.application)); } }); } diff --git a/tests/index.html b/tests/index.html index 64cb47e3..f7ff6521 100644 --- a/tests/index.html +++ b/tests/index.html @@ -10,9 +10,9 @@ {{content-for "head"}} {{content-for "test-head"}} - - - + + + {{content-for "head-footer"}} {{content-for "test-head-footer"}} @@ -21,12 +21,11 @@ {{content-for "body"}} {{content-for "test-body"}} - - - - - - + + + + + {{content-for "body-footer"}} {{content-for "test-body-footer"}} From 306fbd50369d14d9345b0438611b1cf1516ae93c Mon Sep 17 00:00:00 2001 From: Ben Limmer Date: Tue, 30 Aug 2016 18:21:23 -0600 Subject: [PATCH 4/4] Use version compatibility. --- .travis.yml | 9 +++++---- config/ember-try.js | 1 + package.json | 7 +++++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index a5cecc88..22816447 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,12 +10,13 @@ cache: - node_modules before_install: - - export PATH=/usr/local/phantomjs-2.0.0/bin:$PATH - - "npm config set spin false" - - "npm install -g npm@^2" + - npm config set spin false + - npm install -g bower + - bower --version + - npm install phantomjs-prebuilt + - phantomjs --version install: - - npm install -g bower - npm install - bower install diff --git a/config/ember-try.js b/config/ember-try.js index 2743c3b5..f5a25f4c 100644 --- a/config/ember-try.js +++ b/config/ember-try.js @@ -1,5 +1,6 @@ /*jshint node:true*/ module.exports = { + useVersionCompatibility: true, scenarios: [ { name: 'ember-1.13', diff --git a/package.json b/package.json index 15e3e956..e5a12766 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "test": "tests" }, "scripts": { - "test": "ember try:testall", + "test": "ember try:each", "jshint": "mocha" }, "repository": "https://github.com/simplabs/ember-test-selectors", @@ -47,6 +47,9 @@ "lodash": "^4.0.0" }, "ember-addon": { - "configPath": "tests/dummy/config" + "configPath": "tests/dummy/config", + "versionCompatibility": { + "ember": ">1.13" + } } }