diff --git a/.npmignore b/.npmignore index a6799489..74e8c4e8 100644 --- a/.npmignore +++ b/.npmignore @@ -1,16 +1,17 @@ -bower_components/ -tests/ -tmp/ -dist/ -docs/ - +/bower_components +/config/ember-try.js +/dist +/tests +/tmp +**/.gitkeep .bowerrc .codeclimate.yml .editorconfig .ember-cli +.gitignore +.jshintrc +.watchmanconfig .travis.yml -.npmignore -**/.gitkeep bower.json -Brocfile.js -testem.json +ember-cli-build.js +testem.js diff --git a/bower.json b/bower.json index e011c57c..7119b26f 100644 --- a/bower.json +++ b/bower.json @@ -1,8 +1,8 @@ { "name": "ember-cp-validations", "dependencies": { - "ember": "2.3.1", - "ember-cli-shims": "0.1.0", + "ember": "~2.5.0", + "ember-cli-shims": "0.1.1", "ember-cli-test-loader": "0.2.2", "ember-qunit-notifications": "0.1.0", "moment": ">= 2.8.0", diff --git a/config/environment.js b/config/environment.js index be2f39e6..c4a3b124 100644 --- a/config/environment.js +++ b/config/environment.js @@ -2,7 +2,7 @@ * Copyright 2016, Yahoo! Inc. * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. */ - +/* jshint node:true */ 'use strict'; module.exports = function( /* environment, appConfig */ ) { diff --git a/ember-cli-build.js b/ember-cli-build.js index 10cf6545..32952943 100644 --- a/ember-cli-build.js +++ b/ember-cli-build.js @@ -2,7 +2,8 @@ * Copyright 2016, Yahoo! Inc. * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. */ - +/*jshint node:true*/ +/* global require, module */ var EmberAddon = require('ember-cli/lib/broccoli/ember-addon'); module.exports = function(defaults) { diff --git a/package.json b/package.json index 34158538..31d6f8a2 100644 --- a/package.json +++ b/package.json @@ -35,26 +35,26 @@ ], "license": "BSD-3-Clause", "devDependencies": { - "broccoli-asset-rev": "^2.2.0", + "broccoli-asset-rev": "^2.4.2", "ember-ajax": "^2.0.0-beta.2", "ember-cli": "2.5.1", "ember-cli-app-version": "^1.0.0", "ember-cli-blanket": "0.9.4", "ember-cli-dependency-checker": "^1.2.0", "ember-cli-github-pages": "^0.0.8", - "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-inject-live-reload": "^1.4.0", "ember-cli-moment-shim": "1.3.0", "ember-cli-qunit": "^2.0.2", "ember-cli-release": "^1.0.0-beta.1", "ember-cli-sri": "^2.1.0", "ember-cli-uglify": "^1.2.0", "ember-cli-yuidoc": "0.8.3", - "ember-data": "^2.3.0", - "ember-disable-prototype-extensions": "^1.0.0", + "ember-data": "^2.5.0", + "ember-disable-prototype-extensions": "^1.1.0", "ember-disable-proxy-controllers": "^1.0.1", - "ember-export-application-global": "^1.0.4", + "ember-export-application-global": "^1.0.5", "ember-load-initializers": "^0.5.1", "ember-moment": "6.1.0", "ember-resolver": "^2.0.3", @@ -73,7 +73,7 @@ "model" ], "dependencies": { - "ember-cli-babel": "^5.1.5", + "ember-cli-babel": "^5.1.6", "ember-cli-version-checker": "^1.1.4", "ember-getowner-polyfill": "^1.0.1", "exists-sync": "0.0.3", diff --git a/tests/dummy/app/app.js b/tests/dummy/app/app.js index b54456cd..831ad610 100644 --- a/tests/dummy/app/app.js +++ b/tests/dummy/app/app.js @@ -1,21 +1,16 @@ -/** - * Copyright 2016, Yahoo! Inc. - * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. - */ - import Ember from 'ember'; import Resolver from './resolver'; import loadInitializers from 'ember-load-initializers'; import config from './config/environment'; -var App; +let App; 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/router.js b/tests/dummy/app/router.js index 5e3bee59..d6f4ed80 100644 --- a/tests/dummy/app/router.js +++ b/tests/dummy/app/router.js @@ -6,7 +6,7 @@ import Ember from 'ember'; import config from './config/environment'; -var Router = Ember.Router.extend({ +const Router = Ember.Router.extend({ location: config.locationType }); diff --git a/tests/helpers/destroy-app.js b/tests/helpers/destroy-app.js new file mode 100644 index 00000000..c3d4d1ab --- /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 00000000..8c8b74ec --- /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() { + if (options.afterEach) { + options.afterEach.apply(this, arguments); + } + + destroyApp(this.application); + } + }); +} diff --git a/tests/helpers/resolver.js b/tests/helpers/resolver.js index e659e27d..b208d38d 100644 --- a/tests/helpers/resolver.js +++ b/tests/helpers/resolver.js @@ -1,7 +1,7 @@ -import Resolver from 'ember-resolver'; +import Resolver from '../../resolver'; import config from '../../config/environment'; -var resolver = Resolver.create(); +const resolver = Resolver.create(); resolver.namespace = { modulePrefix: config.modulePrefix, diff --git a/tests/helpers/start-app.js b/tests/helpers/start-app.js index 0ee23a0c..e098f1d5 100644 --- a/tests/helpers/start-app.js +++ b/tests/helpers/start-app.js @@ -1,17 +1,14 @@ import Ember from 'ember'; import Application from '../../app'; -import Router from '../../router'; import config from '../../config/environment'; -const assign = Ember.assign || Ember.merge; - export default function startApp(attrs) { - var application; + let application; - var attributes = assign({}, config.APP); - attributes = assign(attributes, attrs); // use defaults, but you can override; + let attributes = Ember.merge({}, config.APP); + attributes = Ember.merge(attributes, attrs); // use defaults, but you can override; - Ember.run(function() { + Ember.run(() => { application = Application.create(attributes); application.setupForTesting(); application.injectTestHelpers(); diff --git a/tests/index.html b/tests/index.html index 04d662b1..2faa1cc6 100644 --- 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"}} @@ -43,13 +43,14 @@ } - {{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"}} + @@ -59,7 +60,7 @@ - {{content-for 'body-footer'}} - {{content-for 'test-body-footer'}} + {{content-for "body-footer"}} + {{content-for "test-body-footer"}}