grunt not running QUnit tests on phantom

前端 未结 2 1224
無奈伤痛
無奈伤痛 2020-12-11 05:38

I\'ve got a repository which is integrated with travis. I\'ve got QUnit tests which I\'d like to run from grunt/node server side and AMD (requirejs). This is the source of m

2条回答
  •  庸人自扰
    2020-12-11 06:14

    It's because the bridge that is injected into the page by grunt qunit is placed there before qunit is loaded by requirejs.

    And it needs to be after. So your tests probably run, but grunt qunit does not know about it because it does not report back.

    I did a quick test placing the bridge code at the end in your qunit extend module and it worked fine.

    You could probably create a qunit bridge module and call that as well in your qunit extend or similar.

    The code from the official bridge should work fine. Just make sure it's fetched after qunit.

    Grunt qunit will still inject the script but just fail since QUnit is undefined, but probably won't do any harm to your tests.

提交回复
热议问题