Skip to content

Commit

Permalink
Merge pull request #86 from albertjan/test-import
Browse files Browse the repository at this point in the history
Avoid importing yadda from ember-cli-yadda
  • Loading branch information
simonihmig authored Oct 26, 2020
2 parents 3eea773 + 2a5683c commit 12077ec
Show file tree
Hide file tree
Showing 23 changed files with 23 additions and 42 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ Because we probably have more features about bananas, we add the `Given I have b
`/tests/acceptance/steps.js`

```js
import { yadda } from 'ember-cli-yadda';
import yadda from 'yadda';
import { visit } from '@ember/test-helpers';

export default function(assert) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { yadda } from 'ember-cli-yadda';
import yadda from 'yadda';
import { expect } from 'chai';
import { visit } from '@ember/test-helpers';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { yadda } from 'ember-cli-yadda';
import yadda from 'yadda';
import { expect } from 'chai';

export default function() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { yadda } from 'ember-cli-yadda';
import yadda from 'yadda';
import { expect } from 'chai';

export default function() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { yadda } from 'ember-cli-yadda';
import yadda from 'yadda';
import { visit } from '@ember/test-helpers';

export default function(assert) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { yadda } from 'ember-cli-yadda';
import yadda from 'yadda';

export default function(assert) {
return yadda.localisation.default.library()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { yadda } from 'ember-cli-yadda';
import yadda from 'yadda';

export default function(assert) {
return yadda.localisation.default.library()
Expand Down
19 changes: 0 additions & 19 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,24 +45,5 @@ module.exports = {
options.persist = true;
}
this._options = options;
},
treeForAddonTestSupport(tree) {
// intentionally not calling _super here
// so that can have our `import`'s be
// import { yadda } from 'ember-cli-yadda';
// shamelessly stolen from https://github.com/cibernox/ember-native-dom-helpers/blob/19adea1683fc386baca6eb7c83cd0a147bd4d586/index.js
// and https://github.com/kaliber5/ember-window-mock/blob/master/index.js#L7-L24

const Funnel = require('broccoli-funnel');

let namespacedTree = new Funnel(tree, {
srcDir: '/',
destDir: `/${this.moduleName()}`,
annotation: `Addon#treeForTestSupport (${this.name})`,
});

return this.preprocessJs(namespacedTree, '/', this.name, {
registry: this.registry,
});
}
};
4 changes: 2 additions & 2 deletions lib/feature-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ class FeatureParser extends Filter {
// import testRunner from 'ember-cli-yadda/test-support/${this.testFramework}/test-runner';

let module = `
import { yadda } from 'ember-cli-yadda';
import yadda from 'yadda';
import * as library from '${stepsPath}/${fileName}-steps';
import yaddaAnnotations from '${basePath}/helpers/yadda-annotations';
import testRunner from 'ember-cli-yadda/${this.testFramework}/test-runner';
import testRunner from 'ember-cli-yadda/test-support/${this.testFramework}/test-runner';
const feature = ${JSON.stringify(feature, null, 2)};
Expand Down
2 changes: 1 addition & 1 deletion node-tests/fixtures/main/mocha/acceptance/steps/steps.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { yadda } from 'ember-cli-yadda';
import yadda from 'yadda';
import { expect } from 'chai';
import { visit } from '@ember/test-helpers';

Expand Down
2 changes: 1 addition & 1 deletion node-tests/fixtures/main/mocha/helpers/yadda.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import { yadda } from 'ember-cli-yadda';
import yadda from 'yadda';
export default yadda;
2 changes: 1 addition & 1 deletion node-tests/fixtures/main/mocha/integration/steps/steps.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { yadda } from 'ember-cli-yadda';
import yadda from 'yadda';
import { expect } from 'chai';

export default function() {
Expand Down
2 changes: 1 addition & 1 deletion node-tests/fixtures/main/mocha/unit/steps/steps.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { yadda } from 'ember-cli-yadda';
import yadda from 'yadda';
import { expect } from 'chai';

export default function() {
Expand Down
2 changes: 1 addition & 1 deletion node-tests/fixtures/main/qunit/acceptance/steps/steps.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { yadda } from 'ember-cli-yadda';
import yadda from 'yadda';
import { visit } from '@ember/test-helpers';

export default function(assert) {
Expand Down
2 changes: 1 addition & 1 deletion node-tests/fixtures/main/qunit/helpers/yadda.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import { yadda } from 'ember-cli-yadda';
import yadda from 'yadda';
export default yadda;
2 changes: 1 addition & 1 deletion node-tests/fixtures/main/qunit/integration/steps/steps.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { yadda } from 'ember-cli-yadda';
import yadda from 'yadda';

export default function(assert) {
return yadda.localisation.default.library()
Expand Down
2 changes: 1 addition & 1 deletion node-tests/fixtures/main/qunit/unit/steps/steps.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { yadda } from 'ember-cli-yadda';
import yadda from 'yadda';

export default function(assert) {
return yadda.localisation.default.library()
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/steps/steps.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { yadda } from 'ember-cli-yadda';
import yadda from 'yadda';
import { visit } from '@ember/test-helpers';

export default function(assert) {
Expand Down
2 changes: 1 addition & 1 deletion tests/helpers/yadda.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import { yadda } from 'ember-cli-yadda';
import yadda from 'yadda';
export default yadda;
2 changes: 1 addition & 1 deletion tests/integration/steps/components/steps.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { yadda } from 'ember-cli-yadda';
import yadda from 'yadda';

export default function(assert) {
return yadda.localisation.default.library()
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/steps/steps.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { yadda } from 'ember-cli-yadda';
import yadda from 'yadda';

export default function(assert) {
return yadda.localisation.default.library()
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/steps/context-steps.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { yadda } from 'ember-cli-yadda';
import yadda from 'yadda';

export default function(assert) {
return yadda.localisation.default.library()
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/steps/steps.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { yadda } from 'ember-cli-yadda';
import yadda from 'yadda';

export default function(assert) {
return yadda.localisation.default.library()
Expand Down

0 comments on commit 12077ec

Please sign in to comment.