diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..318d665 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + extends: './node_modules/ember-cli-eslint/coding-standard/ember-application.js', + "globals": { + "moment": true, + "$": true + } +}; diff --git a/.jshintrc b/.jshintrc deleted file mode 100644 index 9611529..0000000 --- a/.jshintrc +++ /dev/null @@ -1,33 +0,0 @@ -{ - "predef": [ - "document", - "window", - "-Promise", - "$" - ], - "browser": true, - "boss": true, - "curly": true, - "debug": false, - "devel": true, - "eqeqeq": true, - "evil": true, - "forin": false, - "immed": false, - "laxbreak": false, - "newcap": true, - "noarg": true, - "noempty": false, - "nonew": false, - "nomen": false, - "onevar": false, - "plusplus": false, - "regexp": false, - "undef": true, - "sub": true, - "strict": false, - "white": false, - "eqnull": true, - "esnext": true, - "unused": true -} diff --git a/.travis.yml b/.travis.yml index 3d25a59..68b59ab 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,17 +1,9 @@ --- language: node_js node_js: - - "4.2" + - "4" -sudo: required -dist: trusty - -addons: - apt: - sources: - - google-chrome - packages: - - google-chrome-stable +sudo: false cache: directories: @@ -19,6 +11,7 @@ cache: env: - EMBER_TRY_SCENARIO=default + - EMBER_TRY_SCENARIO=ember-1.13 - EMBER_TRY_SCENARIO=ember-release - EMBER_TRY_SCENARIO=ember-beta - EMBER_TRY_SCENARIO=ember-canary @@ -29,15 +22,17 @@ matrix: - env: EMBER_TRY_SCENARIO=ember-canary before_install: - - "export DISPLAY=:99.0" - - "sh -e /etc/init.d/xvfb start" - - "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 script: - - ember try $EMBER_TRY_SCENARIO test + # Usually, it's ok to finish the test scenario without reverting + # to the addon's original dependency state, skipping "cleanup". + - ember try:one $EMBER_TRY_SCENARIO test --skip-cleanup diff --git a/addon/helpers/data-sparkler.js b/addon/helpers/data-sparkler.js index 5e11224..04d73f9 100644 --- a/addon/helpers/data-sparkler.js +++ b/addon/helpers/data-sparkler.js @@ -12,7 +12,7 @@ let getGroupDomain = function({ data, outputKey, groupKey, sortFn }) { return values.map(({ [groupKey]: g }) => g); }; -export function dataSparkler([], hash) { +export function dataSparkler([ params ], hash) { let outputMax = getOutputMax(hash); let groupDomain = getGroupDomain(hash); return { outputMax, groupDomain, ...hash }; diff --git a/addon/helpers/log-debug.js b/addon/helpers/log-debug.js index 6e2323e..e84b9c8 100644 --- a/addon/helpers/log-debug.js +++ b/addon/helpers/log-debug.js @@ -1,3 +1,5 @@ +/* eslint-disable no-console */ + import Ember from 'ember'; export function logDebug([ value ], { msg }) { diff --git a/bower.json b/bower.json index e18b8da..2b2a67f 100644 --- a/bower.json +++ b/bower.json @@ -1,9 +1,8 @@ { "name": "ember-sparkles", "dependencies": { - "ember": "~2.4.3", + "ember": "~2.7.0-beta.1", "ember-cli-shims": "~0.1.1", - "ember-cli-test-loader": "0.2.2", "ember-qunit-notifications": "0.1.0", "moment-range": "^2.2.0" } diff --git a/package.json b/package.json index 18d788d..75da3d4 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "scripts": { "build": "ember build", "start": "ember server", - "test": "ember try:testall" + "test": "ember try:each" }, "repository": "https://github.com/LocusEnergy/ember-sparkles", "engines": { @@ -19,26 +19,27 @@ "license": "MIT", "devDependencies": { "broccoli-asset-rev": "^2.4.2", - "ember-ajax": "0.7.1", - "ember-cli": "2.4.3", + "ember-ajax": "2.0.1", + "ember-cli": "^2.7.0-beta.4", "ember-cli-app-version": "^1.0.0", "ember-cli-dependency-checker": "^1.2.0", + "ember-cli-eslint": "1.6.0", "ember-cli-htmlbars-inline-precompile": "^0.3.1", "ember-cli-inject-live-reload": "^1.4.0", - "ember-cli-qunit": "^1.4.0", + "ember-cli-qunit": "^2.0.0", "ember-cli-release": "1.0.0-beta.2", "ember-cli-sass": "5.3.1", "ember-cli-sri": "^2.1.0", + "ember-cli-test-loader": "^1.1.0", "ember-cli-uglify": "^1.2.0", "ember-concurrency": "0.6.3", - "ember-data": "^2.4.2", + "ember-data": "^2.7.0-beta.1", "ember-disable-prototype-extensions": "^1.1.0", "ember-export-application-global": "^1.0.5", "ember-interpolate-helper": "0.1.1", "ember-load-initializers": "^0.5.1", "ember-lodash": "0.0.7", "ember-resolver": "^2.0.3", - "ember-try": "0.2.4", "loader.js": "^4.0.1" }, "keywords": [ diff --git a/testem.js b/testem.js new file mode 100644 index 0000000..26044b2 --- /dev/null +++ b/testem.js @@ -0,0 +1,13 @@ +/*jshint node:true*/ +module.exports = { + "framework": "qunit", + "test_page": "tests/index.html?hidepassed", + "disable_watching": true, + "launch_in_ci": [ + "PhantomJS" + ], + "launch_in_dev": [ + "PhantomJS", + "Chrome" + ] +}; diff --git a/tests/.eslintrc.js b/tests/.eslintrc.js new file mode 100644 index 0000000..2727171 --- /dev/null +++ b/tests/.eslintrc.js @@ -0,0 +1,3 @@ +module.exports = { + extends: '../node_modules/ember-cli-eslint/coding-standard/ember-testing.js' +}; diff --git a/tests/.jshintrc b/tests/.jshintrc deleted file mode 100644 index 93fced0..0000000 --- a/tests/.jshintrc +++ /dev/null @@ -1,53 +0,0 @@ -{ - "predef": [ - "document", - "window", - "location", - "setTimeout", - "$", - "-Promise", - "define", - "console", - "visit", - "exists", - "fillIn", - "click", - "keyEvent", - "triggerEvent", - "find", - "findWithAssert", - "wait", - "DS", - "andThen", - "currentURL", - "currentPath", - "currentRouteName", - "moment" - ], - "node": false, - "browser": false, - "boss": true, - "curly": true, - "debug": false, - "devel": false, - "eqeqeq": true, - "evil": true, - "forin": false, - "immed": false, - "laxbreak": false, - "newcap": true, - "noarg": true, - "noempty": false, - "nonew": false, - "nomen": false, - "onevar": false, - "plusplus": false, - "regexp": false, - "undef": true, - "sub": true, - "strict": false, - "white": false, - "eqnull": true, - "esnext": true, - "unused": true -} diff --git a/tests/dummy/app/index.html b/tests/dummy/app/index.html index c9b4327..5120bd7 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 2786871..fcc89e7 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/app/utils/fixture-data.js b/tests/dummy/app/utils/fixture-data.js index a4199f4..1f98bff 100644 --- a/tests/dummy/app/utils/fixture-data.js +++ b/tests/dummy/app/utils/fixture-data.js @@ -138,7 +138,7 @@ export const SEPTEMBER_MANY_DATAPOINTS = { { ts: '2014-09-29T00:00:00', value: 1166 - }, + } ] }; diff --git a/tests/dummy/app/views/application.js b/tests/dummy/app/views/application.js index 0b02f2c..4754b79 100644 --- a/tests/dummy/app/views/application.js +++ b/tests/dummy/app/views/application.js @@ -1,5 +1,5 @@ import Ember from 'ember'; export default Ember.Component.extend({ - elementId: 'ember-sparkles', + elementId: 'ember-sparkles' }); diff --git a/tests/dummy/config/environment.js b/tests/dummy/config/environment.js index c59bcd5..2529939 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 8c8b74e..76996fd 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() { - if (options.afterEach) { - options.afterEach.apply(this, arguments); - } - - destroyApp(this.application); + 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 23fff2c..b288dcd 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"}}