Skip to content

Commit

Permalink
Merge pull request #7 from simplabs/add-in-production-env
Browse files Browse the repository at this point in the history
Add the plugin to the registry when in `production` environment
  • Loading branch information
marcoow committed Mar 2, 2016
2 parents 4f27dd8 + e5c81db commit e488c3d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
# ember-test-selectors

This Ember CLI Addon __removes all HTML 5 data attributes starting with
`data-test-` in all environments other than `development` and `test`__. That
allows using data attributes as selectors for integration and acceptance tests
without polluting the generated markup of the production (or staging etc.)
application.
`data-test-` in the `production` environment__. That allows using data
attributes as selectors for integration and acceptance tests without polluting
the generated markup of the production (or staging etc.) application.

## Installation

Expand Down Expand Up @@ -83,16 +82,15 @@ Also it allows to encode more data in the markup like e.g. the post's id:
</article>
```

`ember-test-selectors` makes sure to remove all these `data` attributes in all
environments except `development` and `test` so that __users will have
perfectly clean HTML delivered__:
`ember-test-selectors` makes sure to remove all these `data` attributes in the
`production` environment so that __users will have perfectly clean HTML
delivered__:

```html
<article>
<h1>My great post</h1>
<p>Bla bla…</p>
</article>
```

## License

Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = {
name: 'test-selectors',

included: function() {
if (this.app.env !== 'development' && this.app.env !== 'test') {
if (this.app.env === 'production') {
this.app.registry.add('htmlbars-ast-plugin', {
name: 'strip-test-selectors',
plugin: StringTestSelectorsTransform
Expand Down

0 comments on commit e488c3d

Please sign in to comment.