Skip to content

Commit

Permalink
Update test & CI config
Browse files Browse the repository at this point in the history
  • Loading branch information
Francesco Novy committed Sep 27, 2017
1 parent 9835657 commit 0627eec
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 41 deletions.
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
# See https://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
Expand All @@ -14,4 +14,10 @@
/coverage/*
/libpeerconnection.log
npm-debug.log*
yarn-error.log
testem.log

# ember-try
.node_modules.ember-try/
bower.json.ember-try
package.json.ember-try
28 changes: 16 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
---
language: node_js
node_js:
- "6"
# we recommend testing addons with the same minimum supported node version as Ember CLI
# so that your addon works for all apps
- "4"

sudo: false
dist: trusty

addons:
chrome: stable

cache:
directories:
- $HOME/.npm
- $HOME/.cache # includes bowers cache
yarn: true

env:
# we recommend testing LTS's and latest stable release (bonus points to beta/canary)
- EMBER_TRY_SCENARIO=ember-lts-2.4
# we recommend new addons test the current and previous LTS
# as well as latest stable release (bonus points to beta/canary)
- EMBER_TRY_SCENARIO=ember-lts-2.8
- EMBER_TRY_SCENARIO=ember-lts-2.12
- EMBER_TRY_SCENARIO=ember-release
- EMBER_TRY_SCENARIO=ember-beta
- EMBER_TRY_SCENARIO=ember-canary
Expand All @@ -25,16 +30,15 @@ matrix:
- env: EMBER_TRY_SCENARIO=ember-canary

before_install:
- npm config set spin false
- npm install -g bower phantomjs-prebuilt
- bower --version
- phantomjs --version
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH=$HOME/.yarn/bin:$PATH
- npm install bower -g

install:
- npm install
- yarn install --no-lockfile --non-interactive
- bower install

script:
# 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 test --skip-cleanup
- node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO --skip-cleanup
19 changes: 6 additions & 13 deletions config/ember-try.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
/* eslint-env node */
module.exports = {
useYarn: true,
scenarios: [
{
name: 'ember-lts-2.4',
name: 'ember-lts-2.8',
bower: {
dependencies: {
'ember': 'components/ember#lts-2-4'
'ember': 'components/ember#lts-2-8'
},
resolutions: {
'ember': 'lts-2-4'
'ember': 'lts-2-8'
}
},
npm: {
Expand All @@ -18,18 +19,10 @@ module.exports = {
}
},
{
name: 'ember-lts-2.8',
bower: {
dependencies: {
'ember': 'components/ember#lts-2-8'
},
resolutions: {
'ember': 'lts-2-8'
}
},
name: 'ember-lts-2.12',
npm: {
devDependencies: {
'ember-source': null
'ember-source': '~2.12.0'
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion 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/mydea/ember-date-components",
"engines": {
Expand Down
26 changes: 16 additions & 10 deletions testem.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
/*jshint node:true*/
/* eslint-env node */
module.exports = {
"framework": "qunit",
"test_page": "tests/index.html?hidepassed",
"disable_watching": true,
"launch_in_ci": [
"PhantomJS"
test_page: 'tests/index.html?hidepassed',
disable_watching: true,
launch_in_ci: [
'Chrome'
],
"launch_in_dev": [
"PhantomJS",
"Chrome"
]
launch_in_dev: [
'Chrome'
],
browser_args: {
Chrome: [
'--disable-gpu',
'--headless',
'--remote-debugging-port=9222',
'--window-size=1440,900'
]
}
};
9 changes: 9 additions & 0 deletions tests/dummy/config/targets.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* eslint-env node */
module.exports = {
browsers: [
'ie 9',
'last 1 Chrome versions',
'last 1 Firefox versions',
'last 1 Safari versions'
]
};
6 changes: 2 additions & 4 deletions tests/helpers/module-for-acceptance.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ import Ember from 'ember';
import startApp from '../helpers/start-app';
import destroyApp from '../helpers/destroy-app';

const {
RSVP
} = Ember;
const { RSVP: { resolve } } = Ember;

export default function(name, options = {}) {
module(name, {
Expand All @@ -19,7 +17,7 @@ export default function(name, options = {}) {

afterEach() {
let afterEach = options.afterEach && options.afterEach.apply(this, arguments);
return RSVP.Promise.resolve(afterEach).then(() => destroyApp(this.application));
return resolve(afterEach).then(() => destroyApp(this.application));
}
});
}

0 comments on commit 0627eec

Please sign in to comment.