Skip to content

Commit

Permalink
bump dependencies, refactor tests slightly
Browse files Browse the repository at this point in the history
  • Loading branch information
eflanagan0 committed Apr 6, 2018
1 parent d73c0b6 commit fb82460
Show file tree
Hide file tree
Showing 15 changed files with 121 additions and 153 deletions.
14 changes: 10 additions & 4 deletions .eslintrc.js
Expand Up @@ -26,18 +26,24 @@ module.exports = {
'config/**/*.js',
'tests/dummy/config/**/*.js'
],
excludedFiles: ['addon/**'],
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'],
Expand Down
2 changes: 1 addition & 1 deletion .npmignore
Expand Up @@ -7,8 +7,8 @@
.bowerrc
.editorconfig
.ember-cli
.gitignore
.eslintrc.js
.gitignore
.watchmanconfig
.travis.yml
bower.json
Expand Down
2 changes: 2 additions & 0 deletions .travis.yml
Expand Up @@ -21,6 +21,7 @@ env:
# as well as latest stable release (bonus points to beta/canary)
- EMBER_TRY_SCENARIO=ember-lts-2.12
- EMBER_TRY_SCENARIO=ember-lts-2.16
- EMBER_TRY_SCENARIO=ember-lts-2.18
- EMBER_TRY_SCENARIO=ember-release
- EMBER_TRY_SCENARIO=ember-beta
- EMBER_TRY_SCENARIO=ember-canary
Expand All @@ -37,6 +38,7 @@ before_install:
- npm --version

script:
- npm run lint:js
# Usually, it's ok to finish the test scenario without reverting
# to the addon's original dependency state, skipping "cleanup".
- node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO --skip-cleanup
Expand Down
134 changes: 65 additions & 69 deletions config/ember-try.js
@@ -1,74 +1,70 @@
module.exports = {
scenarios: [
{
name: 'ember-lts-2.12',
npm: {
devDependencies: {
'ember-source': '~2.12.0'
}
}
},
{
name: 'ember-lts-2.16',
npm: {
devDependencies: {
'ember-source': '~2.16.0'
}
}
},
{
name: 'ember-release',
bower: {
dependencies: {
'ember': 'components/ember#release'
'use strict';

const getChannelURL = require('ember-source-channel-url');

module.exports = function() {
return Promise.all([
getChannelURL('release'),
getChannelURL('beta'),
getChannelURL('canary'),
]).then((urls) => {
return {
scenarios: [
{
name: 'ember-lts-2.12',
npm: {
devDependencies: {
'ember-source': '~2.12.0'
}
}
},
resolutions: {
'ember': 'release'
}
},
npm: {
devDependencies: {
'ember-source': null
}
}
},
{
name: 'ember-beta',
bower: {
dependencies: {
'ember': 'components/ember#beta'
{
name: 'ember-lts-2.16',
npm: {
devDependencies: {
'ember-source': '~2.16.0'
}
}
},
resolutions: {
'ember': 'beta'
}
},
npm: {
devDependencies: {
'ember-source': null
}
}
},
{
name: 'ember-canary',
bower: {
dependencies: {
'ember': 'components/ember#canary'
{
name: 'ember-lts-2.18',
npm: {
devDependencies: {
'ember-source': '~2.18.0'
}
}
},
resolutions: {
'ember': 'canary'
}
},
npm: {
devDependencies: {
'ember-source': null
{
name: 'ember-release',
npm: {
devDependencies: {
'ember-source': urls[0]
}
}
},
{
name: 'ember-beta',
npm: {
devDependencies: {
'ember-source': urls[1]
}
}
},
{
name: 'ember-canary',
npm: {
devDependencies: {
'ember-source': urls[2]
}
}
},
{
name: 'ember-default',
npm: {
devDependencies: {}
}
}
}
},
{
name: 'ember-default',
npm: {
devDependencies: {}
}
}
]
]
};
});
};
11 changes: 8 additions & 3 deletions package.json
Expand Up @@ -30,6 +30,7 @@
},
"scripts": {
"build": "ember build",
"lint:js": "eslint ./*.js addon addon-test-support app config lib server test-support tests",
"start": "ember serve",
"test": "ember try:each"
},
Expand All @@ -39,23 +40,27 @@
"devDependencies": {
"broccoli-asset-rev": "^2.4.5",
"ember-ajax": "^3.0.0",
"ember-cli": "2.17.1",
"ember-cli": "~3.0.2",
"ember-cli-dependency-checker": "^2.0.0",
"ember-cli-eslint": "^4.2.1",
"ember-cli-htmlbars": "^2.0.1",
"ember-cli-htmlbars-inline-precompile": "^1.0.0",
"ember-cli-inject-live-reload": "^1.4.1",
"ember-cli-qunit": "^4.1.1",
"ember-cli-qunit": "^4.3.2",
"ember-cli-shims": "^1.2.0",
"ember-cli-sri": "^2.1.0",
"ember-cli-uglify": "^1.2.0",
"ember-data": "^2.17.0",
"ember-disable-prototype-extensions": "^1.1.2",
"ember-export-application-global": "^2.0.0",
"ember-load-initializers": "^1.0.0",
"ember-maybe-import-regenerator": "^0.1.6",
"ember-resolver": "^4.0.0",
"ember-source": "~2.17.0",
"ember-source": "~3.0.0",
"ember-source-channel-url": "^1.0.1",
"ember-try": "^0.2.23",
"eslint-plugin-ember": "^5.0.0",
"eslint-plugin-node": "^5.2.1",
"loader.js": "^4.2.3"
},
"ember-addon": {
Expand Down
5 changes: 4 additions & 1 deletion testem.js
Expand Up @@ -11,11 +11,14 @@ module.exports = {
Chrome: {
mode: 'ci',
args: [
// --no-sandbox is needed when running Chrome inside a container
process.env.TRAVIS ? '--no-sandbox' : null,

'--disable-gpu',
'--headless',
'--remote-debugging-port=0',
'--window-size=1440,900'
]
].filter(Boolean)
}
}
};
21 changes: 11 additions & 10 deletions tests/acceptance/initializers-test.js
@@ -1,18 +1,19 @@
import { test, module } from 'qunit';
import moduleForAcceptance from '../../tests/helpers/module-for-acceptance';
import { visit, currentURL } from '@ember/test-helpers';
import { setupApplicationTest } from 'ember-qunit';

module('beforeAcceptance test');
test('initializers', function(assert) {
assert.equal(self.fooInitializeWasCalled, undefined, 'initializer:foo should not yet be called');
assert.equal(self.barInitializeWasCalled, undefined, 'instance-initializer:bar should not yet be called');
module('Acceptance | before test', function() {
test('initializers', function(assert) {
assert.equal(self.fooInitializeWasCalled, undefined, 'initializer:foo should not yet be called');
assert.equal(self.barInitializeWasCalled, undefined, 'instance-initializer:bar should not yet be called');
});
});

moduleForAcceptance('Acceptance | initializers');

test('visiting /', function(assert) {
visit('/');
module('Acceptance | initializers', function(hooks) {
setupApplicationTest(hooks);
test('visiting /', async function(assert) {
await visit('/');

andThen(function() {
assert.equal(self.fooInitializeWasCalled, true, 'initializer:foo should have been called');
assert.equal(self.barInitializeWasCalled, true, 'instance-initializer:boo should have been called');
assert.equal(currentURL(), '/');
Expand Down
2 changes: 2 additions & 0 deletions tests/dummy/config/environment.js
Expand Up @@ -40,8 +40,10 @@ module.exports = function(environment) {
ENV.APP.LOG_VIEW_LOOKUPS = false;

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

// eslint-disable-next-line no-empty
if (environment === 'production') {

}
Expand Down
22 changes: 16 additions & 6 deletions tests/dummy/config/targets.js
@@ -1,8 +1,18 @@
'use strict';

const browsers = [
'last 1 Chrome versions',
'last 1 Firefox versions',
'last 1 Safari versions'
];

const isCI = !!process.env.CI;
const isProduction = process.env.EMBER_ENV === 'production';

if (isCI || isProduction) {
browsers.push('ie 11');
}

module.exports = {
browsers: [
'ie 9',
'last 1 Chrome versions',
'last 1 Firefox versions',
'last 1 Safari versions'
]
browsers
};
15 changes: 0 additions & 15 deletions tests/dummy/public/crossdomain.xml

This file was deleted.

Empty file added tests/helpers/.gitkeep
Empty file.
5 changes: 0 additions & 5 deletions tests/helpers/destroy-app.js

This file was deleted.

21 changes: 0 additions & 21 deletions tests/helpers/module-for-acceptance.js

This file was deleted.

17 changes: 0 additions & 17 deletions tests/helpers/start-app.js

This file was deleted.

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 fb82460

Please sign in to comment.