Skip to content

Commit

Permalink
Merge pull request #22 from blimmer/chore/fix-caching
Browse files Browse the repository at this point in the history
Fix Caching + Fix Tests + Updates
  • Loading branch information
marcoow authored Sep 5, 2016
2 parents eb03190 + 306fbd5 commit cd01e97
Show file tree
Hide file tree
Showing 17 changed files with 102 additions and 107 deletions.
14 changes: 0 additions & 14 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,8 @@ insert_final_newline = true
indent_style = space
indent_size = 2

[*.js]
indent_style = space
indent_size = 2

[*.hbs]
insert_final_newline = false
indent_style = space
indent_size = 2

[*.css]
indent_style = space
indent_size = 2

[*.html]
indent_style = space
indent_size = 2

[*.{diff,md}]
trim_trailing_whitespace = false
2 changes: 1 addition & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@
"strict": false,
"white": false,
"eqnull": true,
"esnext": true,
"esversion": 6,
"unused": true
}
20 changes: 11 additions & 9 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
bower_components/
tests/
tmp/
dist/

/bower_components
/config/ember-try.js
/dist
/tests
/tmp
**/.gitkeep
.bowerrc
.editorconfig
.ember-cli
.gitignore
.jshintrc
.watchmanconfig
.travis.yml
.npmignore
**/.gitkeep
bower.json
Brocfile.js
testem.json
ember-cli-build.js
testem.js
9 changes: 5 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ cache:
- node_modules

before_install:
- export PATH=/usr/local/phantomjs-2.0.0/bin:$PATH
- "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

Expand Down
13 changes: 3 additions & 10 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
{
"name": "ember-test-selectors",
"dependencies": {
"ember": "2.3.0",
"ember-cli-shims": "0.1.0",
"ember-cli-test-loader": "0.2.2",
"ember-load-initializers": "0.1.7",
"ember-qunit-notifications": "0.1.0",
"jquery": "1.11.3",
"loader.js": "^3.5.0"
},
"resolutions": {
"ember": "2.2.0"
"ember": "~2.7.0",
"ember-cli-shims": "0.1.1",
"ember-qunit-notifications": "0.1.0"
}
}
55 changes: 30 additions & 25 deletions config/ember-try.js
Original file line number Diff line number Diff line change
@@ -1,44 +1,49 @@
/*jshint node:true*/
module.exports = {
useVersionCompatibility: true,
scenarios: [
{
name: 'default',
dependencies: { }
},
{
name: 'ember-1-13',
dependencies: {
'ember': 'components/ember#1.13'
},
resolutions: {
'ember': '1.13'
name: 'ember-1.13',
bower: {
dependencies: {
'ember': '~1.13.0'
},
resolutions: {
'ember': '~1.13.0'
}
}
},
{
name: 'ember-release',
dependencies: {
'ember': 'components/ember#release'
},
resolutions: {
'ember': 'release'
bower: {
dependencies: {
'ember': 'components/ember#release'
},
resolutions: {
'ember': 'release'
}
}
},
{
name: 'ember-beta',
dependencies: {
'ember': 'components/ember#beta'
},
resolutions: {
'ember': 'beta'
bower: {
dependencies: {
'ember': 'components/ember#beta'
},
resolutions: {
'ember': 'beta'
}
}
},
{
name: 'ember-canary',
dependencies: {
'ember': 'components/ember#canary'
},
resolutions: {
'ember': 'canary'
bower: {
dependencies: {
'ember': 'components/ember#canary'
},
resolutions: {
'ember': 'canary'
}
}
}
]
Expand Down
7 changes: 5 additions & 2 deletions ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@ var StripTestSelectorsTransform = require('./strip-test-selectors');

module.exports = function(defaults) {
var app = new EmberAddon(defaults, {
// Add options here
'ember-test-selectors': {
environments: ['test']
}
});

// add the StripTestSelectorsTransform to the registry, so the dummy app has
// it added in the HTMLBars build pipeline: all data-test-* attributes are
// therefore stripped
app.registry.add('htmlbars-ast-plugin', {
name: 'strip-test-selectors',
plugin: StripTestSelectorsTransform
plugin: StripTestSelectorsTransform,
baseDir: function() { return __dirname; }
});

return app.toTree();
Expand Down
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ module.exports = {

registry.add('htmlbars-ast-plugin', {
name: 'strip-test-selectors',
plugin: StripTestSelectorsTransform
plugin: StripTestSelectorsTransform,
baseDir: function() { return __dirname; }
});
}
}
Expand Down
34 changes: 19 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"test": "tests"
},
"scripts": {
"test": "ember try:testall",
"test": "ember try:each",
"jshint": "mocha"
},
"repository": "https://github.com/simplabs/ember-test-selectors",
Expand All @@ -17,24 +17,25 @@
"author": "",
"license": "MIT",
"devDependencies": {
"broccoli-asset-rev": "^2.2.0",
"ember-ajax": "0.7.1",
"ember-cli": "2.3.0-beta.1",
"broccoli-asset-rev": "^2.4.2",
"ember-ajax": "^2.0.1",
"ember-cli": "2.7.0",
"ember-cli-app-version": "^1.0.0",
"ember-cli-dependency-checker": "^1.2.0",
"ember-cli-htmlbars": "^1.0.1",
"ember-cli-htmlbars": "^1.0.3",
"ember-cli-htmlbars-inline-precompile": "^0.3.1",
"ember-cli-inject-live-reload": "^1.3.1",
"ember-cli-qunit": "^1.2.1",
"ember-cli-release": "0.2.8",
"ember-cli-sri": "^2.0.0",
"ember-cli-inject-live-reload": "^1.4.0",
"ember-cli-jshint": "^1.0.0",
"ember-cli-qunit": "^2.0.0",
"ember-cli-release": "^0.2.9",
"ember-cli-sri": "^2.1.0",
"ember-cli-test-loader": "^1.1.0",
"ember-cli-uglify": "^1.2.0",
"ember-data": "^2.3.0",
"ember-disable-prototype-extensions": "^1.0.0",
"ember-disable-proxy-controllers": "^1.0.1",
"ember-export-application-global": "^1.0.4",
"ember-data": "^2.7.0",
"ember-disable-prototype-extensions": "^1.1.0",
"ember-export-application-global": "^1.0.5",
"ember-resolver": "^2.0.3",
"ember-try": "~0.0.8",
"loader.js": "^4.0.1",
"mocha": "^1.21.4",
"mocha-jshint": "^2.3.1"
},
Expand All @@ -46,6 +47,9 @@
"lodash": "^4.0.0"
},
"ember-addon": {
"configPath": "tests/dummy/config"
"configPath": "tests/dummy/config",
"versionCompatibility": {
"ember": ">1.13"
}
}
}
5 changes: 3 additions & 2 deletions testem.json → testem.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
/*jshint node:true*/
module.exports = {
"framework": "qunit",
"test_page": "tests/index.html?hidepassed",
"disable_watching": true,
Expand All @@ -9,4 +10,4 @@
"PhantomJS",
"Chrome"
]
}
};
2 changes: 1 addition & 1 deletion tests/.jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@
"strict": false,
"white": false,
"eqnull": true,
"esnext": true,
"esversion": 6,
"unused": true
}
2 changes: 1 addition & 1 deletion tests/dummy/app/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Ember from 'ember';
import Resolver from './resolver';
import loadInitializers from 'ember/load-initializers';
import loadInitializers from 'ember-load-initializers';
import config from './config/environment';

let App;
Expand Down
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
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() {
destroyApp(this.application);

if (options.afterEach) {
options.afterEach.apply(this, arguments);
}
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 cd01e97

Please sign in to comment.