0

Up until recently I was including the file...

https://raw.githubusercontent.com/rwjblue/ember-qunit-builds/master/dist/globals/main.js

...in a 'TestRunner' page which I would open to run all of my Ember unit tests. All was great.

A few days ago, that file disappeared from github, so I started searching for the new way get my unit tests (e.g. moduleForComponent tests) running.

I first tried to simply include the ember-qunit.js file from the ember-qunit-builds repo, but errors like could not find module 'ember' came back.

Am I correct in saying that ember-qunit somehow depends on ember-test-helpers? I'm a bit lost as to which references I should be including before my test code...I have a feeling that I'm missing something related to ES6-style modules (export/import etc) with which I have little experience.

Could somebody perhaps point me in the right direction here? What should I be including on my 'TestRunner.html' page to get the 'moduleForComponent'-style tests happening again?

Note: I'm in a .NET environment where I understand that the frequently-mentioned tools for 'installing' this stuff (like Bower/npm) are not really available (are these a necessity for getting this to work?).

sammy34
  • 5,312
  • 5
  • 29
  • 42

1 Answers1

1

I'm not really sure where your problem is, but I can paste you relevant parts of my index.html (I'm using Ember App Kit here):

<!-- @if tests=true -->
<script src="/vendor/ember-shim.js"></script>
<link rel="stylesheet" href="/vendor/qunit/qunit/qunit.css">
<script src="/vendor/qunit/qunit/qunit.js"></script>
<script src="/vendor/qunit-shim.js"></script>
<script src="/vendor/ember-qunit/dist/named-amd/main.js"></script>
<div id="qunit"></div>
<!-- @endif -->

and

<!-- @if tests=true -->
<div id="qunit-fixture"></div>
<script src="/tests/tests.js"></script>
<script src="/tests/test-helper.js"></script>
<script src="/tests/test-loader.js"></script>
<script src="/testem.js"></script>
<!-- @endif -->

If you're looking particularly for the dist/globals/main.js file, then you can always go to github and select an older tag (not master), then go to the file's raw version. Here's the link to the 0.1.8 version:

https://raw.githubusercontent.com/rwjblue/ember-qunit/v0.1.8/dist/globals/main.js

If you want to stay up-to-date, use this repo: https://github.com/rwjblue/ember-qunit-builds Does this provide any help?

andrusieczko
  • 2,824
  • 12
  • 23
  • Thanks a lot for your suggestion/input. The structure of my html page looks basically the same. The key seems to be this file: "/vendor/ember-qunit/dist/named-amd/main.js". Where do I find that on the web now? A few days ago, it was removed from the ember-qunit-builds repo, and I'm not sure how to get it again :(... – sammy34 Feb 05 '15 at 18:07
  • Great, thanks. That should solve my problem for now, so I've accepted your answer. I guess I'm just concerned that I'll run into a similar problem if I want to stay "up-to-date" with ember-qunit. If I understand correctly, they won't be providing such a "main.js" going forward. Do you know what the process will then be? Are we expected to "build" it somehow? – sammy34 Feb 06 '15 at 12:48
  • 1
    hey, if you just go to https://github.com/rwjblue/ember-qunit, then it's the first paragraph saying: "IMPORTANT NOTE - The build process is currently changing for this project. In v0.1.8 and below, builds were pushed to a dist/ dir. Going forward, we're going to push builds to a separate repo: ember-qunit-builds. Until this transition is complete, please update your bower.json if it's referencing rwjblue/ember-qunit#master. Instead specify a version (rwjblue/ember-qunit#v0.1.8) or SHA (f3f852789bc80486afae1a9ddb7810356050fe9b or older)." – andrusieczko Feb 06 '15 at 14:02
  • 1
    so you can just pull the newest ones from https://github.com/rwjblue/ember-qunit-builds – andrusieczko Feb 06 '15 at 14:04
  • Thanks again for your response. I was indeed already pulling the main.js file from ember-qunit-builds (see the first link in my original post), but they removed it. If it were there then my problem would be solved, but sadly it's not :(. I'm not sure if it's just currently "missing", or if there's some new way that we're supposed to be getting that same source (trying the ember-qunit.js file from that repo as a drop-in replacement for main.js is no good). – sammy34 Feb 06 '15 at 20:31
  • 1
    oh, I'm sorry... maybe you just have to pull the normal ember-qunit.js file then? – andrusieczko Feb 07 '15 at 03:37
  • I did think to do that, yes. When I include the ember-qunit.js file in place of the old main.js file, however, errors like "could not find module 'ember'" pop up (line 60 of the ember-qunit.js source). That makes me think that there are some other dependencies that need to be satisfied, but at that point I'm a bit lost: I haven't been able to find any documentation on including these files, and I'm not even sure if ember-qunit.js IS the file we're supposed to be including. – sammy34 Feb 07 '15 at 05:37