Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change test directories #515

Closed
mehulkar opened this issue Jul 24, 2019 · 6 comments
Closed

Change test directories #515

mehulkar opened this issue Jul 24, 2019 · 6 comments

Comments

@mehulkar
Copy link
Contributor

mehulkar commented Jul 24, 2019

Change test directories, blueprints, generators

  • tests/acceptance -> tests/application
  • tests/integration > tests/rendering
  • tests/unit/utils -> tests/unit
  • tests/unit/controllers -> tests/container/controllers
  • tests/unit/routes -> tests/container/routes
  • tests/unit/services -> tests/container/services

To match the names given here: https://guides.emberjs.com/release/testing/

@rwjblue
Copy link
Member

rwjblue commented Sep 17, 2019

Generally seems good to me.

@josemarluedke
Copy link

josemarluedke commented Sep 17, 2019

This seems like a natural change. 👍

For components using Component Templates Co-location, it would be nice to have tests co-located as well but definably would require an RFC. Co-located tests was one of the nice things I was hoping to get with MU.

@buschtoens
Copy link
Contributor

For components using Component Templates Co-location, it would be nice to have tests co-located

Why stop there?

I think that co-locating tests for most files makes a lot of sense, e.g.:

some-app
├── README.md
├── app
│   ├── app.js
│   ├── application
│   │   ├── controller.js
│   │   ├── controller.test.js
│   │   ├── route.js
│   │   ├── route.test.js
│   │   └── template.hbs
│   ├── components
│   │   ├── another-component.css
│   │   ├── another-component.hbs
│   │   ├── another-component.js
│   │   ├── another-component.test.js
│   │   ├── pod-style
│   │   │   ├── index.css
│   │   │   ├── index.hbs
│   │   │   ├── index.js
│   │   │   └── test.js
│   │   ├── some-component.css
│   │   ├── some-component.hbs
│   │   ├── some-component.js
│   │   └── some-component.test.js
│   ├── helpers
│   │   ├── some-helper.js
│   │   └── some-helper.test.js
│   ├── index.html
│   ├── resolver.js
│   ├── router.js
│   ├── services
│   │   ├── some-service.js
│   │   └── some-service.test.js
│   ├── some-route
│   │   ├── controller.js
│   │   ├── controller.test.js
│   │   ├── route.js
│   │   ├── route.test.js
│   │   └── template.hbs
│   ├── styles
│   │   └── app.css
│   └── utils
│       ├── some-util.js
│       └── some-util.test.js
├── config
│   ├── environment.js
│   ├── optional-features.json
│   └── targets.js
├── ember-cli-build.js
├── package.json
├── testem.js
├── tests
│   ├── another-acceptance.test.js
│   ├── index.html
│   ├── some-acceptance.test.js
│   └── test-helper.js
└── yarn.lock

@mehulkar
Copy link
Contributor Author

I'm usually not in favor of colocating tests and it would definitely be out of scope for this particular RFC if I was going to write it

@NullVoxPopuli
Copy link
Contributor

I think colocation of unit and integration tests would be super valuable. But def out of scope here

@mehulkar
Copy link
Contributor Author

Opened #575 for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants