Search code examples
javascriptember-clisaucelabstestem

Ember CLI tests on Sauce Labs


How can I get ember-cli tests running on Sauce Labs? Testem has an example configuration, but I don't know how to translate that into the ember-cli compiled tests since the testem.json gets packed into the build when tests run.

I tried doing an ember build --env=test and then putting "test_page": "dist/tests/index.html" in my testem.js and just running testem ci --port=8080 as it is in the example, but that gives me 0 tests run.


Solution

  • I believe I have this mostly solved (some issues remain with individual browsers). For posterity you can view my solution here*:

    The things that seem to be necessary:

    1. Use NVM to manage node on OSX, things only started to work when I stopped having to sudo random junk.

    2. Don't use localhost, I used localtest here for the hostname, but you can use anything - sauce and localhost don't get along very well.

    3. The command is ember test --port=8080 --host=localtest

    4. I put my sauce stuff in a different testem config file so I can still run ember test on my dev machine.

    Hopefully having a starting place saves someone else from doing all of the wrong things I did originally.

    *You probably don't need all of that, as we're currently using ember-cli api stubs to mock our API during development so we need to run a separate instance of ember serve.