From 823b3f389a4ab63aee647600523b1b3c9f8715fd Mon Sep 17 00:00:00 2001 From: Jeremy Brown Date: Mon, 29 Feb 2016 18:30:47 -0600 Subject: [PATCH 1/2] Closes softlayer/sl-ember-behavior#152 --- .npmignore | 17 ++++--- .watchmanconfig | 2 +- README.md | 2 +- bower.json | 15 ++---- config/ember-try.js | 41 +++++++++------ config/environment.js | 1 + ember-cli-build.js | 69 ++++++++++++++------------ package.json | 40 ++++++++------- tests/dummy/app/app.js | 6 +-- tests/dummy/app/index.html | 8 +-- tests/dummy/app/resolver.js | 3 ++ tests/helpers/destroy-app.js | 5 ++ tests/helpers/module-for-acceptance.js | 23 +++++++++ tests/helpers/resolver.js | 2 +- tests/helpers/start-app.js | 2 +- tests/index.html | 21 ++++---- 16 files changed, 150 insertions(+), 107 deletions(-) create mode 100644 tests/dummy/app/resolver.js create mode 100644 tests/helpers/destroy-app.js create mode 100644 tests/helpers/module-for-acceptance.js diff --git a/.npmignore b/.npmignore index d522ca2..076a740 100644 --- a/.npmignore +++ b/.npmignore @@ -1,15 +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 ember-cli-build.js -Brocfile.js testem.json diff --git a/.watchmanconfig b/.watchmanconfig index 5e9462c..e7834e3 100644 --- a/.watchmanconfig +++ b/.watchmanconfig @@ -1,3 +1,3 @@ { - "ignore_dirs": ["tmp"] + "ignore_dirs": ["tmp", "dist"] } diff --git a/README.md b/README.md index e38af23..2200446 100755 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Latest Release](https://img.shields.io/github/release/softlayer/sl-ember-behavior.svg)](https://github.com/softlayer/sl-ember-behavior/releases) ![Ember CLI version](https://img.shields.io/badge/ember%20cli-1.13.8-blue.svg) [![License](https://img.shields.io/npm/l/sl-ember-behavior.svg)](LICENSE.md) [![Downloads](https://img.shields.io/npm/dm/sl-ember-behavior.svg)](https://www.npmjs.com/package/sl-ember-behavior) +[![Latest Release](https://img.shields.io/github/release/softlayer/sl-ember-behavior.svg)](https://github.com/softlayer/sl-ember-behavior/releases) ![Ember CLI version](https://img.shields.io/badge/ember%20cli-2.3.0-blue.svg) [![License](https://img.shields.io/npm/l/sl-ember-behavior.svg)](LICENSE.md) [![Downloads](https://img.shields.io/npm/dm/sl-ember-behavior.svg)](https://www.npmjs.com/package/sl-ember-behavior) [![Dependencies](https://img.shields.io/david/softlayer/sl-ember-behavior.svg)](https://david-dm.org/softlayer/sl-ember-behavior) [![Dev Dependencies](https://img.shields.io/david/dev/softlayer/sl-ember-behavior.svg)](https://david-dm.org/softlayer/sl-ember-behavior#info=devDependencies) diff --git a/bower.json b/bower.json index 1299db4..316244e 100755 --- a/bower.json +++ b/bower.json @@ -1,17 +1,10 @@ { "name": "sl-ember-behavior", "dependencies": { - "ember": "1.13.7", - "ember-cli-shims": "ember-cli/ember-cli-shims#0.0.3", - "ember-cli-test-loader": "ember-cli-test-loader#0.2.1", - "ember-load-initializers": "ember-cli/ember-load-initializers#0.1.5", - "ember-qunit": "0.4.14", - "ember-qunit-notifications": "0.0.7", - "ember-resolver": "~0.1.18", - "jquery": "1.11.3", - "loader.js": "ember-cli/loader.js#3.3.0", - "qunit": "~1.18.0", - "sinonjs": "~1.14.1" + "ember": "~2.3.1", + "ember-cli-shims": "0.1.0", + "ember-cli-test-loader": "0.2.2", + "ember-qunit-notifications": "0.1.0" }, "devDependencies": { "blanket": "~1.1.5" diff --git a/config/ember-try.js b/config/ember-try.js index 83dab0f..be846e1 100644 --- a/config/ember-try.js +++ b/config/ember-try.js @@ -1,34 +1,43 @@ +/*jshint node:true*/ module.exports = { scenarios: [ { name: 'default', - dependencies: { } + bower: { + dependencies: { } + } }, { 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' + } } } ] diff --git a/config/environment.js b/config/environment.js index 0dfaed4..28a787b 100644 --- a/config/environment.js +++ b/config/environment.js @@ -1,3 +1,4 @@ +/*jshint node:true*/ 'use strict'; module.exports = function(/* environment, appConfig */) { diff --git a/ember-cli-build.js b/ember-cli-build.js index a39c912..89eff8f 100755 --- a/ember-cli-build.js +++ b/ember-cli-build.js @@ -1,44 +1,47 @@ +/* jshint node:true*/ /* global require, module */ -const EmberApp = require( 'ember-cli/lib/broccoli/ember-addon' ); +const EmberAddon = require( 'ember-cli/lib/broccoli/ember-addon' ); const packageConfig = require( './package.json' ); const replace = require( 'broccoli-string-replace' ); module.exports = function( defaults ) { - const app = new EmberApp( defaults, { - // Add options here - }); + const app = new EmberAddon( defaults, { + // Add options here + }); - /* - This build file specifes the options for the dummy test app of this - addon, located in `/tests/dummy` - This build file does *not* influence how the addon or the app using it - behave. You most likely want to be modifying `./index.js` or app's build file - */ + /* + This build file specifies the options for the dummy test app of this + addon, located in `/tests/dummy` + This build file does *not* influence how the addon or the app using it + behave. You most likely want to be modifying `./index.js` or app's build file + */ - app.import( app.bowerDirectory + '/ember/ember-template-compiler.js', { - type: 'test' - }); + app.import( app.bowerDirectory + '/ember/ember-template-compiler.js', { + type: 'test' + }); - const tree = replace( app.toTree(), { - files: [ - 'index.html', - 'assets/dummy.js' - ], + const tree = replace( app.toTree(), { + files: [ + 'index.html', + 'assets/dummy.js' + ], - patterns: [ - { - match: /REPLACE_META_DESCRIPTION/g, - replacement: packageConfig[ 'description' ] - }, { - match: /REPLACE_META_KEYWORDS/g, - replacement: packageConfig[ 'keywords' ].join( ', ' ) + - ', ember, ember cli' - }, { - match: /REPLACE_APPLICATION_VERSION/g, - replacement: packageConfig[ 'version' ] - } - ] - }); + patterns: [ + { + match: /REPLACE_META_DESCRIPTION/g, + replacement: packageConfig[ 'description' ] + }, + { + match: /REPLACE_META_KEYWORDS/g, + replacement: packageConfig[ 'keywords' ].join( ', ' ) + + ', ember, ember cli' + }, + { + match: /REPLACE_APPLICATION_VERSION/g, + replacement: packageConfig[ 'version' ] + } + ] + }); - return tree; + return tree; }; diff --git a/package.json b/package.json index c82f12f..e743671 100644 --- a/package.json +++ b/package.json @@ -41,29 +41,33 @@ "author": "Jeremy Brown (http://www.notmessenger.com)", "license": "MIT", "dependencies": { - "ember-cli-babel": "^5.0.0", - "ember-cli-htmlbars": "1.0.0" + "ember-cli-babel": "^5.1.6", + "ember-cli-htmlbars": "^1.0.3" }, "devDependencies": { - "broccoli-asset-rev": "^2.1.2", - "broccoli-string-replace": "0.1.0", - "ember-cli": "1.13.8", - "ember-cli-app-version": "0.5.0", - "ember-cli-blanket": "0.6.2", - "ember-cli-dependency-checker": "^1.0.1", + "broccoli-asset-rev": "^2.4.2", + "broccoli-string-replace": "0.1.1", + "ember-ajax": "0.7.1", + "ember-cli": "2.3.0", + "ember-cli-app-version": "^1.0.0", + "ember-cli-blanket": "0.8.0", + "ember-cli-dependency-checker": "^1.2.0", "ember-cli-doc-server": "1.1.0", - "ember-cli-htmlbars-inline-precompile": "^0.2.0", - "ember-cli-ic-ajax": "0.2.1", + "ember-cli-htmlbars-inline-precompile": "^0.3.1", "ember-cli-inject-live-reload": "^1.3.1", - "ember-cli-jsdoc": "1.3.0", - "ember-cli-qunit": "^1.0.0", + "ember-cli-jsdoc": "1.3.1", + "ember-cli-qunit": "^1.2.1", "ember-cli-uglify": "^1.2.0", - "ember-disable-prototype-extensions": "^1.0.0", - "ember-disable-proxy-controllers": "^1.0.0", - "ember-export-application-global": "^1.0.3", - "ember-sinon": "0.2.1", - "ember-try": "0.0.6", - "phantomjs": "1.9.18", + "ember-disable-prototype-extensions": "^1.1.0", + "ember-disable-proxy-controllers": "^1.0.1", + "ember-export-application-global": "^1.0.4", + "ember-load-initializers": "^0.5.0", + "ember-resolver": "^2.0.3", + "ember-sinon": "0.5.0", + "ember-try": "^0.1.2", + "loader.js": "^4.0.0", + "phantomjs": "1.9.19", + "sl-ember-test-helpers": "1.11.1", "sl-eslint": "0.4.0" } } diff --git a/tests/dummy/app/app.js b/tests/dummy/app/app.js index add3000..b336d94 100755 --- a/tests/dummy/app/app.js +++ b/tests/dummy/app/app.js @@ -1,6 +1,6 @@ import Ember from 'ember'; -import Resolver from 'ember/resolver'; -import loadInitializers from 'ember/load-initializers'; +import Resolver from './resolver'; +import loadInitializers from 'ember-load-initializers'; import config from './config/environment'; let App; @@ -10,7 +10,7 @@ Ember.MODEL_FACTORY_INJECTIONS = true; App = Ember.Application.extend({ modulePrefix: config.modulePrefix, podModulePrefix: config.podModulePrefix, - Resolver: Resolver + Resolver }); loadInitializers( App, config.modulePrefix ); diff --git a/tests/dummy/app/index.html b/tests/dummy/app/index.html index 33e77c7..22ee178 100755 --- a/tests/dummy/app/index.html +++ b/tests/dummy/app/index.html @@ -9,7 +9,7 @@ - {{content-for 'head'}} + {{content-for "head"}} @@ -17,15 +17,15 @@ - {{content-for 'head-footer'}} + {{content-for "head-footer"}} - {{content-for 'body'}} + {{content-for "body"}} - {{content-for 'body-footer'}} + {{content-for "body-footer"}} diff --git a/tests/dummy/app/resolver.js b/tests/dummy/app/resolver.js new file mode 100644 index 0000000..2fb563d --- /dev/null +++ b/tests/dummy/app/resolver.js @@ -0,0 +1,3 @@ +import Resolver from 'ember-resolver'; + +export default Resolver; diff --git a/tests/helpers/destroy-app.js b/tests/helpers/destroy-app.js new file mode 100644 index 0000000..cd79357 --- /dev/null +++ b/tests/helpers/destroy-app.js @@ -0,0 +1,5 @@ +import Ember from 'ember'; + +export default function destroyApp( application ) { + Ember.run( application, 'destroy' ); +} diff --git a/tests/helpers/module-for-acceptance.js b/tests/helpers/module-for-acceptance.js new file mode 100644 index 0000000..48927ae --- /dev/null +++ b/tests/helpers/module-for-acceptance.js @@ -0,0 +1,23 @@ +import { module } from 'qunit'; +import startApp from '../helpers/start-app'; +import destroyApp from '../helpers/destroy-app'; + +export default function( name, options = {} ) { + module( name, { + beforeEach() { + this.application = startApp(); + + if ( options.beforeEach ) { + options.beforeEach.apply( this, arguments ); + } + }, + + afterEach() { + destroyApp( this.application ); + + if ( options.afterEach ) { + options.afterEach.apply( this, arguments ); + } + } + }); +} diff --git a/tests/helpers/resolver.js b/tests/helpers/resolver.js index 42c4285..50e9179 100755 --- a/tests/helpers/resolver.js +++ b/tests/helpers/resolver.js @@ -1,4 +1,4 @@ -import Resolver from 'ember/resolver'; +import Resolver from '../../resolver'; import config from '../../config/environment'; const resolver = Resolver.create(); diff --git a/tests/helpers/start-app.js b/tests/helpers/start-app.js index 331e5ec..a9c6db8 100755 --- a/tests/helpers/start-app.js +++ b/tests/helpers/start-app.js @@ -6,7 +6,7 @@ export default function startApp( attrs ) { let application; let attributes = Ember.merge( {}, config.APP ); - attributes = Ember.merge( attributes, attrs ); // use defaults, but you can override; + attributes = Ember.merge( attributes, attrs ); // use defaults, but you can override; Ember.run( function() { application = Application.create( attributes ); diff --git a/tests/index.html b/tests/index.html index 18f3a4e..50ae9f5 100755 --- a/tests/index.html +++ b/tests/index.html @@ -7,8 +7,8 @@ - {{content-for 'head'}} - {{content-for 'test-head'}} + {{content-for "head"}} + {{content-for "test-head"}} @@ -21,22 +21,23 @@ } - {{content-for 'head-footer'}} - {{content-for 'test-head-footer'}} + {{content-for "head-footer"}} + {{content-for "test-head-footer"}} - {{content-for 'body'}} - {{content-for 'test-body'}} + {{content-for "body"}} + {{content-for "test-body"}} - - + + + - {{content-for 'body-footer'}} - {{content-for 'test-body-footer'}} + {{content-for "body-footer"}} + {{content-for "test-body-footer"}} From 6463ad6570cd2490379991a40ddc22179d2d6a9e Mon Sep 17 00:00:00 2001 From: Jeremy Brown Date: Mon, 29 Feb 2016 20:51:48 -0600 Subject: [PATCH 2/2] Update sl-ember-test-helpers --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e743671..1b21084 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ "ember-try": "^0.1.2", "loader.js": "^4.0.0", "phantomjs": "1.9.19", - "sl-ember-test-helpers": "1.11.1", + "sl-ember-test-helpers": "1.12.0", "sl-eslint": "0.4.0" } }