ember-clitestem

Putting ember-cli tests in pods


I want to try to place tests in pods, so instead of

tests
  unit
    routes
      resource-test.js
app
  pods
    resource
      route.js

I want to have

app
  pods
    resource
      route.js
      route-test.js

This seems to be taking pods to their logical conclusion--namely, to include all pod-related "things" in the pod, instead of scattered somewhere else in the directory structure.

I am able to get the tests picked up by setting the src_files property in testem.json to include app/pods/**/*-test.js.

However, I am running into a problem with jshint. The .jshintrc in tests has predefs for things like moduleFor. So tests located inside tests pass jshint fine. However, app has its own .jshintrc, which doesn't define the test-related globals. So jshint fails on the test files under app/pods. I would prefer to keep a separate .jshintrc for testing-related files, but how can I have one .jshintrc applied to the test files and another one applied to non-test files?

More generally, are there any best practices or tricks for putting test files into the pod structure?


Solution

  • Unfortunately this is not yet supported, although I (one of the ember-cli maintainers) hope this to be a reality sometime soon!