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

Add the plugin to the registry when in production environment #7

Merged
merged 1 commit into from
Mar 2, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's another occurrence of this near the end of the README.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not anymore 😉


## 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