Removing QUnit from Your Ember Build

The Pluto Journal
Jun 1 · 2 min read

Tired of seeing Error: No tests were run in the console of your Ember application's dev environment?

Want to throw out QUnit from your Ember app? It’s not always so simple as deleting your /test folder, and it can be a bit of a pain in the side.

Well if you don’t, I don’t know why you’re here, but read on, I guess. We can do this in a simple series of steps. It’s pretty intuitive to remove QUnit using Grunt, so far as I can tell, and so for this tutorial we’ll assume you are struggling with this task using Bower and/or NPM includes.

Set “Test” Flag to False in Ember CLI Build

Modify your ember-cli-build.js like so:

module.exports = function(defaults) {
   var app = new EmberApp(defaults, {
+    tests: false,
     'ember-cli-babel': {
       presets: ["env"],
       plugins: ["transform-es2015-arrow-functions"],

Note line 3.

Remove Imports from the Ember CLI Build

Remove any QUnit and Ember-QUnit imports from your ember-cli-build.jsi.e.:

- app.import('bower_components/qunit/qunit/qunit.js');
- app.import('bower_components/ember-qunit/ember-qunit.amd.js');

Remove any of the following packages from your package.json and/or bower.json.

  • “qunit”
  • “ember-qunit”
  • “ember-cli-test-loader” [Optional]
  • “phantomjs” [Optional]
  • “ember-qunit-notifications”
  • “ember-cli-qunit”

Remove Any Test Scripts from your CI

Although this seems a bit counter-intuitive if you have one. (Are you sure you want to remove your test suite from your CI?)

   - npm run lint:hbs
   - npm run lint:js
   - npm test <-- delete

CLI Cleanup Command

Let’s clean our caches and get rid of un-used dependency folders. In other words, let’s refresh our modules folders.

$ bower cache clean && bower install --force && bower prune && rm -rf node_modules && npm cache clean --force && npm i
The Pluto Journal

Written by

A technical blog. Hacks, attacks, patches, and cracks await.