Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle Mellander committed Mar 2, 2017
1 parent 317af62 commit 4c98ba3
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,24 @@ change.

## Configuration

You can set your preferences for ember-test-with-data in the
`/config/environment.js` file in your ember-cli app. Example:
You can set your preferences for hidden environments in ember-test-with-data in
the `ember-cli-build.js` file in your ember-cli app. Example:

```js
// ember-cli-build.js
module.exports = function(defaults) {
var app = new EmberApp(defaults, {
'ember-test-with-data': {
hidden: EmberApp.env() === 'production'
}
})

return app.toTree()
}
```

Because the other options are run after build, then they are set in the apps
`config/environment.js` file. Example:

```js
// config/environment.js
Expand All @@ -70,7 +86,6 @@ module.exports = function(environment) {
};

ENV['ember-test-with-data'] = {
hiddenEnvironments: ['staging', 'production'], // default ['production']
dataTestSuffix: 'id', // default null
autoTag: true // default true
}
Expand All @@ -79,8 +94,11 @@ module.exports = function(environment) {

###### Settings

* **hiddenEnvironments** (default: `['production']`) - Sets the environments in
which data-test attributes will be stripped.
**ember-cli-build options**
* **hidden** (default: `env === 'production'`) - Sets whether data-test
attributes will be stripped.

**config/environment options**
* **dataTestSuffix** (default: `null`) - Sets the suffix of the data-test
identifier. A value of null makes the generated test attributes as `data-test`,
but setting it to `id` makes the generated test attributes `data-test-id`.
Expand Down

0 comments on commit 4c98ba3

Please sign in to comment.