# Headless qunit integration tests?

**URL:** https://meta.discourse.org/t/headless-qunit-integration-tests/45513
**Category:** Development
**Created:** [June 10, 2016, 1:48am UTC](https://meta.discourse.org/t/headless-qunit-integration-tests/45513 "2016-06-10T01:48:50Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![rimian](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rimian/32/120658_2.png) [@rimian](https://meta.discourse.org/u/rimian)
#### Post date: [June 10, 2016, 1:48am UTC](https://meta.discourse.org/t/headless-qunit-integration-tests/45513/1 "2016-06-10T01:48:50Z")

</div>

I’d like to run my integration tests via the command line with support for running a subset of the entire test suite. I’m thinking about setting up gulp and phantomjs to run the tests. Something like: [https://www.npmjs.com/package/node-qunit-phantomjs](https://www.npmjs.com/package/node-qunit-phantomjs)

Has anyone set something like this up? Any pointers?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [June 10, 2016, 6:12am UTC](https://meta.discourse.org/t/headless-qunit-integration-tests/45513/2 "2016-06-10T06:12:34Z")

</div>

We already have a rake task for this…

```plaintext
rake qunit:test

```

---

<div class="post-metadata">

### Author: ![rimian](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rimian/32/120658_2.png) [@rimian](https://meta.discourse.org/u/rimian)
#### Post date: [June 13, 2016, 11:22pm UTC](https://meta.discourse.org/t/headless-qunit-integration-tests/45513/3 "2016-06-13T23:22:50Z")

</div>

Oh, of course! Thanks for that.

I’m trying to work out how to run single tests so I can be TDD.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [June 13, 2016, 11:38pm UTC](https://meta.discourse.org/t/headless-qunit-integration-tests/45513/4 "2016-06-13T23:38:57Z")

</div>

In general we use the web browser to run single tests using `/qunit` path

 ![](https://global.discourse-cdn.com/meta/original/3X/4/9/4946940f9dba8d9f15a2a1705caf0e0a8e46df83.png)

It is doable using the CLI just not implemented yet.

---

<div class="post-metadata">

### Author: ![rimian](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rimian/32/120658_2.png) [@rimian](https://meta.discourse.org/u/rimian)
#### Post date: [June 14, 2016, 2:15am UTC](https://meta.discourse.org/t/headless-qunit-integration-tests/45513/5 "2016-06-14T02:15:30Z")

</div>

Here’s a PR that implements that:

[https://github.com/discourse/discourse/pull/4268](https://github.com/discourse/discourse/pull/4268)

🙂

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [June 14, 2016, 2:50am UTC](https://meta.discourse.org/t/headless-qunit-integration-tests/45513/6 "2016-06-14T02:50:44Z")

</div>

Merged it in 🙂 good idea,

My dream is somehow to integrate this stuff into `rake autospec` that would be mighty cool.

---

<div class="post-metadata">

### Author: ![rimian](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rimian/32/120658_2.png) [@rimian](https://meta.discourse.org/u/rimian)
#### Post date: [June 14, 2016, 4:22am UTC](https://meta.discourse.org/t/headless-qunit-integration-tests/45513/7 "2016-06-14T04:22:08Z")

</div>

Anything that makes testing easier!

It wants to run the tests multiple times which doesn’t make a lot of sense if you’re running a subset via rake on the command line. I included a RETRY flag. I would say the default value should be false but I guess that will break other things.

[https://github.com/discourse/discourse/pull/4269](https://github.com/discourse/discourse/pull/4269)

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [June 14, 2016, 2:50pm UTC](https://meta.discourse.org/t/headless-qunit-integration-tests/45513/8 "2016-06-14T14:50:12Z")

</div>

> [@sam](#):
>
> that would be mighty cool.

I believe @zogstrip took a stab at this and it had many issues. In particular it seemed significantly slower than before.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [June 14, 2016, 2:52pm UTC](https://meta.discourse.org/t/headless-qunit-integration-tests/45513/9 "2016-06-14T14:52:12Z")

</div>

I believe that’s what @sam is suggesting. Having it integrated **nicely** would be mighty cool 😉
