Skip to content

Commit

Permalink
internal: test for app excluding mirage
Browse files Browse the repository at this point in the history
  • Loading branch information
samselikoff committed Feb 5, 2019
1 parent 0bc26c2 commit 8cd7ee4
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,17 @@
{{#if wifi.isConnected}}
<p>We ran the initializer</p>
{{/if}}

<p>
Mirage modules in project:
<span data-test-id="mirage-module-count">
{{mirageModules.length}}
</span>
</p>

<p>
Other modules in project:
<span data-test-id="other-module-count">
{{otherIncludedModules.length}}
</span>
</p>
3 changes: 2 additions & 1 deletion test-projects/02-app-that-excludes-mirage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
"fastboot": "*",
"jsdom": "*",
"loader.js": "*",
"qunit": "*"
"qunit": "*",
"qunit-dom": "*"
},
"engines": {
"node": ">= 8.*"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { test } from 'qunit';
import moduleForAcceptance from 'basic-app/tests/helpers/module-for-acceptance';

moduleForAcceptance('Acceptance | modules');

test('only 1 module (the no-op initializer) is included in the build', function(assert) {
visit('/');

andThen(function() {
assert.dom('[data-test-id="mirage-module-count"]').hasText('0');
assert.dom('[data-test-id="other-module-count"]').hasText('1');
});
});

0 comments on commit 8cd7ee4

Please sign in to comment.