Headless qunit integration tests?

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: node-qunit-phantomjs - npm

Has anyone set something like this up? Any pointers?

We already have a rake task for this…

rake qunit:test
7 Likes

Oh, of course! Thanks for that.

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

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

It is doable using the CLI just not implemented yet.

2 Likes

Here’s a PR that implements that:

https://github.com/discourse/discourse/pull/4268

:slight_smile:

3 Likes

Merged it in :slight_smile: good idea,

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

3 Likes

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

2 Likes

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

1 Like

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

3 Likes