Skip to content

Commit

Permalink
Merge pull request #186 from scalvert/ember-modules-conversion
Browse files Browse the repository at this point in the history
Converting imports to use ember modules
  • Loading branch information
Turbo87 authored Apr 26, 2018
2 parents d7487e0 + 3d0a306 commit aa6d953
Show file tree
Hide file tree
Showing 10 changed files with 146 additions and 72 deletions.
5 changes: 2 additions & 3 deletions addon/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Ember from 'ember';

const { isNone, deprecate } = Ember;
import { isNone } from '@ember/utils';
import { deprecate } from '@ember/application/deprecations';

const message = `Using the "testSelector" helper function is deprecated as it obfuscates the selectors, making the tests harder to understand.
Please use the actual attribute selectors instead, e.g. "[data-test-my-element]" instead of "testSelector('my-element')".`;
Expand Down
4 changes: 1 addition & 3 deletions test-support/helpers/ember-test-selectors.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import Ember from 'ember';
import { deprecate } from '@ember/application/deprecations';
import testSelector from 'ember-test-selectors';

const { deprecate } = Ember;

let message = 'Importing testSelector() from "<appname>/tests/helpers/ember-test-selectors" is deprecated. ' +
'Please import testSelector() from "ember-test-selectors" instead.';

Expand Down
4 changes: 1 addition & 3 deletions tests/dummy/app/components/data-test-component.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import Ember from 'ember';

const { Component } = Ember;
import Component from '@ember/component';

export default Component.extend({
// we're explicitly setting attributeBindings here to test that
Expand Down
4 changes: 1 addition & 3 deletions tests/dummy/app/components/print-test-attributes.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import Ember from 'ember';

const { Component } = Ember;
import Component from '@ember/component';

const component = Component.extend();

Expand Down
4 changes: 1 addition & 3 deletions tests/dummy/app/controllers/bind-test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import Ember from 'ember';
import Controller from '@ember/controller';
import { hasPositionalParams } from 'dummy/version-checks';

const { Controller } = Ember;

export default Controller.extend({
hasPositionalParams,
});
4 changes: 1 addition & 3 deletions tests/helpers/destroy-app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import Ember from 'ember';

const { run } = Ember;
import { run } from '@ember/runloop';

export default function destroyApp(application) {
run(application, 'destroy');
Expand Down
4 changes: 1 addition & 3 deletions tests/helpers/module-for-acceptance.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { Promise } from 'rsvp';
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() {
Expand Down
5 changes: 2 additions & 3 deletions tests/helpers/start-app.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import Ember from 'ember';
import { merge } from '@ember/polyfills';
import { run } from '@ember/runloop';
import Application from '../../app';
import config from '../../config/environment';

const { merge, run } = Ember;

export default function startApp(attrs) {
let application;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import { moduleForComponent, test, skip } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';

import config from 'dummy/config/environment';
import { hasReliablePositionalParams, hasEmberVersion } from 'dummy/version-checks';
import {
hasReliablePositionalParams,
hasEmberVersion
} from 'dummy/version-checks';

moduleForComponent('print-test-attributes', 'StripTestSelectorsTransform plugin', {
integration: true
Expand Down
Loading

0 comments on commit aa6d953

Please sign in to comment.