Skip to content

Commit

Permalink
Require host to provide testing fixture DOM elements.
Browse files Browse the repository at this point in the history
Instead of `ember-qunit` automatically injecting some DOM elements into
`test-body` (via the `contentFor` hook) this requires the project itself
to add these DOM elements.

This dove tails with the changes to make `qunit` a peer dependency as
this now puts the app in full control of the testing fixtures.
  • Loading branch information
rwjblue committed Aug 17, 2020
1 parent 3989fdc commit 4bca327
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 deletions.
17 changes: 0 additions & 17 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,23 +73,6 @@ module.exports = {
return this._targetOptions;
},

contentFor: function (type) {
// Skip if insertContentForTestBody === false.
if (
type === 'test-body' &&
!(this.targetOptions().insertContentForTestBody === false)
) {
return stripIndent`
<div id="qunit"></div>
<div id="qunit-fixture"></div>
<div id="ember-testing-container">
<div id="ember-testing"></div>
</div>
`;
}
},

treeForVendor: function (tree) {
const MergeTrees = require('broccoli-merge-trees');
const Funnel = require('broccoli-funnel');
Expand Down
9 changes: 8 additions & 1 deletion tests/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@
</head>
<body>
{{content-for "body"}}
{{content-for "test-body"}}

<div id="qunit"></div>
<div id="qunit-fixture">
<div id="ember-testing-container">
<div id="ember-testing"></div>
</div>
</div>


<script src="/testem.js" integrity=""></script>
<script src="{{rootURL}}assets/vendor.js"></script>
Expand Down

0 comments on commit 4bca327

Please sign in to comment.