Skip to content

Commit

Permalink
upgrades ember-cli, adds ember-cli-eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
zigahertz committed Jul 5, 2016
1 parent 854d28d commit 9d10bf8
Show file tree
Hide file tree
Showing 17 changed files with 68 additions and 135 deletions.
7 changes: 7 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
extends: './node_modules/ember-cli-eslint/coding-standard/ember-application.js',
"globals": {
"moment": true,
"$": true
}
};
33 changes: 0 additions & 33 deletions .jshintrc

This file was deleted.

27 changes: 11 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
---
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:
- node_modules

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
Expand All @@ -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
2 changes: 1 addition & 1 deletion addon/helpers/data-sparkler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down
2 changes: 2 additions & 0 deletions addon/helpers/log-debug.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable no-console */

import Ember from 'ember';

export function logDebug([ value ], { msg }) {
Expand Down
3 changes: 1 addition & 2 deletions bower.json
Original file line number Diff line number Diff line change
@@ -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"
}
Expand Down
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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": [
Expand Down
13 changes: 13 additions & 0 deletions testem.js
Original file line number Diff line number Diff line change
@@ -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"
]
};
3 changes: 3 additions & 0 deletions tests/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: '../node_modules/ember-cli-eslint/coding-standard/ember-testing.js'
};
53 changes: 0 additions & 53 deletions tests/.jshintrc

This file was deleted.

8 changes: 4 additions & 4 deletions tests/dummy/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@

{{content-for "head"}}

<link rel="stylesheet" href="assets/vendor.css">
<link rel="stylesheet" href="assets/dummy.css">
<link rel="stylesheet" href="{{rootURL}}assets/vendor.css">
<link rel="stylesheet" href="{{rootURL}}assets/dummy.css">

{{content-for "head-footer"}}
</head>
<body>
{{content-for "body"}}

<script src="assets/vendor.js"></script>
<script src="assets/dummy.js"></script>
<script src="{{rootURL}}assets/vendor.js"></script>
<script src="{{rootURL}}assets/dummy.js"></script>

{{content-for "body-footer"}}
</body>
Expand Down
3 changes: 2 additions & 1 deletion tests/dummy/app/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion tests/dummy/app/utils/fixture-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export const SEPTEMBER_MANY_DATAPOINTS = {
{
ts: '2014-09-29T00:00:00',
value: 1166
},
}
]
};

Expand Down
2 changes: 1 addition & 1 deletion tests/dummy/app/views/application.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Ember from 'ember';

export default Ember.Component.extend({
elementId: 'ember-sparkles',
elementId: 'ember-sparkles'
});
3 changes: 1 addition & 2 deletions tests/dummy/config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = function(environment) {
var ENV = {
modulePrefix: 'dummy',
environment: environment,
baseURL: '/',
rootURL: '/',
locationType: 'auto',
EmberENV: {
FEATURES: {
Expand All @@ -29,7 +29,6 @@ module.exports = function(environment) {

if (environment === 'test') {
// Testem prefers this...
ENV.baseURL = '/';
ENV.locationType = 'none';

// keep test console output quieter
Expand Down
12 changes: 6 additions & 6 deletions tests/helpers/module-for-acceptance.js
Original file line number Diff line number Diff line change
@@ -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));
}
});
}
17 changes: 8 additions & 9 deletions tests/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
{{content-for "head"}}
{{content-for "test-head"}}

<link rel="stylesheet" href="assets/vendor.css">
<!--<link rel="stylesheet" href="assets/dummy.css">-->
<link rel="stylesheet" href="assets/test-support.css">
<link rel="stylesheet" href="{{rootURL}}assets/vendor.css">
<!-- <link rel="stylesheet" href="{{rootURL}}assets/dummy.css"> -->
<link rel="stylesheet" href="{{rootURL}}assets/test-support.css">

{{content-for "head-footer"}}
{{content-for "test-head-footer"}}
Expand All @@ -21,12 +21,11 @@
{{content-for "body"}}
{{content-for "test-body"}}

<script src="testem.js" integrity=""></script>
<script src="assets/vendor.js"></script>
<script src="assets/test-support.js"></script>
<script src="assets/dummy.js"></script>
<script src="assets/tests.js"></script>
<script src="assets/test-loader.js"></script>
<script src="{{rootURL}}testem.js" integrity=""></script>
<script src="{{rootURL}}assets/vendor.js"></script>
<script src="{{rootURL}}assets/test-support.js"></script>
<script src="{{rootURL}}assets/dummy.js"></script>
<script src="{{rootURL}}assets/tests.js"></script>

{{content-for "body-footer"}}
{{content-for "test-body-footer"}}
Expand Down

0 comments on commit 9d10bf8

Please sign in to comment.