Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converting imports to use ember modules #186

Merged
merged 1 commit into from
Apr 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we can do that in the test-support folder, as that one is transpiled by the host ember-cli-babel version, and we can't be sure that that is using ember-cli-babel@^6.6.

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