简体   繁体   中英

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?

不幸的是,这还不支持,虽然我(其中一个ember-cli维护者)希望这很快就会成为现实!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM