Skip to content

Commit

Permalink
DEPENDENCY: upgrade to ember-cli v2.18
Browse files Browse the repository at this point in the history
  • Loading branch information
toranb committed Jan 13, 2018
1 parent c81071a commit e170b9b
Show file tree
Hide file tree
Showing 15 changed files with 435 additions and 154 deletions.
46 changes: 42 additions & 4 deletions .eslintrc.js
Expand Up @@ -4,15 +4,53 @@ module.exports = {
ecmaVersion: 2017,
sourceType: 'module'
},
plugins: [
'ember'
],
extends: 'eslint:recommended',
env: {
browser: true
},
plugins: [
'ember'
],
rules: {
'ember/no-old-shims': 'error',
'ember/new-module-imports': 'error'
}
},
overrides: [
// node files
{
files: [
'index.js',
'testem.js',
'ember-cli-build.js',
'config/**/*.js',
'tests/dummy/config/**/*.js'
],
excludedFiles: [
'app/**',
'addon/**',
'tests/dummy/app/**'
],
parserOptions: {
sourceType: 'script',
ecmaVersion: 2015
},
env: {
browser: false,
node: true
},
plugins: ['node'],
rules: Object.assign({}, require('eslint-plugin-node').configs.recommended.rules, {
// add your custom rules and overrides for node files here
})
},

// test files
{
files: ['tests/**/*.js'],
excludedFiles: ['tests/dummy/**/*.js'],
env: {
embertest: true
}
}
]
};
7 changes: 6 additions & 1 deletion .npmignore
Expand Up @@ -7,10 +7,15 @@
.bowerrc
.editorconfig
.ember-cli
.gitignore
.eslintrc.js
.gitignore
.watchmanconfig
.travis.yml
bower.json
ember-cli-build.js
testem.js

# ember-try
.node_modules.ember-try/
bower.json.ember-try
package.json.ember-try
5 changes: 3 additions & 2 deletions .travis.yml
Expand Up @@ -13,8 +13,8 @@ cache:
yarn: true

env:
- EMBER_TRY_SCENARIO=ember-2.12.X
- EMBER_TRY_SCENARIO=ember-2.17.X
- EMBER_TRY_SCENARIO=ember-2.16.X
- EMBER_TRY_SCENARIO=ember-2.18.X
- EMBER_TRY_SCENARIO=ember-beta

before_install:
Expand All @@ -25,4 +25,5 @@ install:
- yarn install --no-lockfile --non-interactive

script:
- npm run lint:js
- node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO test --skip-cleanup
8 changes: 4 additions & 4 deletions config/ember-try.js
Expand Up @@ -3,18 +3,18 @@ module.exports = {
useYarn: true,
scenarios: [
{
name: 'ember-2.12.X',
name: 'ember-2.16.X',
npm: {
devDependencies: {
'ember-source': '~2.12.0'
'ember-source': '~2.16.0'
}
}
},
{
name: 'ember-2.17.X',
name: 'ember-2.18.X',
npm: {
devDependencies: {
'ember-source': '~2.17.0'
'ember-source': '~2.18.0'
}
}
},
Expand Down
1 change: 0 additions & 1 deletion config/environment.js
@@ -1,4 +1,3 @@
/* eslint-env node */
'use strict';

module.exports = function(/* environment, appConfig */) {
Expand Down
1 change: 0 additions & 1 deletion ember-cli-build.js
@@ -1,4 +1,3 @@
/* eslint-env node */
'use strict';

const EmberAddon = require('ember-cli/lib/broccoli/ember-addon');
Expand Down
1 change: 0 additions & 1 deletion index.js
@@ -1,4 +1,3 @@
/* eslint-env node */
'use strict';

module.exports = {
Expand Down
9 changes: 6 additions & 3 deletions package.json
Expand Up @@ -8,7 +8,8 @@
},
"scripts": {
"build": "ember build",
"start": "ember server",
"lint:js": "eslint ./*.js addon addon-test-support app config lib server test-support tests",
"start": "ember serve",
"test": "ember try:each"
},
"homepage": "https://github.com/ember-redux/ember-redux",
Expand All @@ -26,7 +27,7 @@
"license": "MIT",
"devDependencies": {
"broccoli-asset-rev": "^2.4.5",
"ember-cli": "~2.17.0",
"ember-cli": "~2.18.0",
"ember-cli-dependency-checker": "^2.0.0",
"ember-cli-eslint": "^4.2.1",
"ember-cli-htmlbars": "^2.0.1",
Expand All @@ -46,7 +47,9 @@
"ember-redux-shim": "^2.5.0",
"ember-redux-thunk-shim": "^2.4.0",
"ember-resolver": "^4.0.0",
"ember-source": "~2.17.0",
"ember-source": "~2.18.0",
"eslint-plugin-ember": "^5.0.0",
"eslint-plugin-node": "^5.2.1",
"ember-symbol-observable": "^1.0.0",
"eslint-plugin-ember": "^4.5.0",
"loader.js": "^4.2.3",
Expand Down
5 changes: 2 additions & 3 deletions testem.js
@@ -1,4 +1,3 @@
/* eslint-env node */
module.exports = {
test_page: 'tests/index.html?hidepassed',
disable_watching: true,
Expand All @@ -14,9 +13,9 @@ module.exports = {
args: [
'--disable-gpu',
'--headless',
'--remote-debugging-port=9222',
'--remote-debugging-port=0',
'--window-size=1440,900'
]
},
}
}
};
45 changes: 20 additions & 25 deletions tests/acceptance/es2015-class-test.js
@@ -1,34 +1,29 @@
import { run } from '@ember/runloop';
import { test, module } from 'qunit';
import startApp from '../helpers/start-app';
import hasEmberVersion from 'ember-test-helpers/has-ember-version';

var application;

if (!hasEmberVersion(2, 12)) {
module('Acceptance | es2015 class e2e test', {
beforeEach() {
application = startApp();
},
afterEach() {
run(application, 'destroy');
}
});

module('Acceptance | es2015 class e2e test', {
beforeEach() {
application = startApp();
},
afterEach() {
run(application, 'destroy');
}
test('es2015 class based components dispatch & render state from redux', function(assert) {
visit('/clazz');
andThen(() => {
assert.equal(currentURL(), '/clazz');
assert.equal(find('.clazz-state').text(), '0');
assert.equal(find('.clazz-up').text(), 'up');
});

test('es2015 class based components dispatch & render state from redux', function(assert) {
visit('/clazz');
andThen(() => {
assert.equal(currentURL(), '/clazz');
assert.equal(find('.clazz-state').text(), '0');
assert.equal(find('.clazz-up').text(), 'up');
});
click('.clazz-up');
andThen(() => {
assert.equal(currentURL(), '/clazz');
assert.equal(find('.clazz-state').text(), '1');
assert.equal(find('.clazz-color').text(), 'orange');
});
click('.clazz-up');
andThen(() => {
assert.equal(currentURL(), '/clazz');
assert.equal(find('.clazz-state').text(), '1');
assert.equal(find('.clazz-color').text(), 'orange');
});

}
});
4 changes: 2 additions & 2 deletions tests/dummy/config/environment.js
@@ -1,4 +1,3 @@
/* eslint-env node */
'use strict';

module.exports = function(environment) {
Expand Down Expand Up @@ -41,10 +40,11 @@ module.exports = function(environment) {
ENV.APP.LOG_VIEW_LOOKUPS = false;

ENV.APP.rootElement = '#ember-testing';
ENV.APP.autoboot = false;
}

if (environment === 'production') {

// here you can enable a production-specific feature
}

return ENV;
Expand Down
1 change: 0 additions & 1 deletion tests/dummy/config/targets.js
@@ -1,4 +1,3 @@
/* eslint-env node */
module.exports = {
browsers: [
'ie 9',
Expand Down
1 change: 1 addition & 0 deletions tests/helpers/start-app.js
Expand Up @@ -28,6 +28,7 @@ registerAsyncHelper('ajax', ajax);

export default function startApp(attrs) {
let attributes = merge({}, config.APP);
attributes.autoboot = true;
attributes = merge(attributes, attrs); // use defaults, but you can override;

return run(() => {
Expand Down
3 changes: 2 additions & 1 deletion tests/test-helper.js
@@ -1,7 +1,8 @@
import Application from '../app';
import config from '../config/environment';
import { setApplication } from '@ember/test-helpers';
import { start } from 'ember-qunit';

setApplication(Application.create({ autoboot: false }));
setApplication(Application.create(config.APP));

start();

0 comments on commit e170b9b

Please sign in to comment.