Skip to content

Commit aa1e221

Browse files
committed
Readme for native-dom transforms
1 parent eff9a7c commit aa1e221

1 file changed

Lines changed: 21 additions & 4 deletions

File tree

README.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ npm install -g ember-test-helpers-codemod
2424
cd my-ember-app-or-addon
2525
ember-test-helpers-codemod --type=integration tests/integration
2626
ember-test-helpers-codemod --type=acceptance tests/acceptance
27+
ember-test-helpers-codemod --type=native-dom tests
2728
```
2829

2930
## Transformations
@@ -55,10 +56,10 @@ This addon will perform the following transformations suitable for integration t
5556
| `this.$('.foo').each((index, elem) => {...})` | `this.element.querySelectorAll('.foo').forEach((elem, index) => {...})` | `each.js` |
5657

5758

58-
If you want to run only selected transforms on your code, you can just the needed transform:
59+
If you want to run only selected transforms on your code, you can pick just the needed transform:
5960

6061
```bash
61-
jscodeshift -t ../ember-test-helpers-codemod/lib/transforms/click.js tests/integration
62+
jscodeshift -t ../ember-test-helpers-codemod/lib/transforms/integration/click.js tests/integration
6263
```
6364

6465
### Acceptance tests
@@ -84,10 +85,26 @@ These transformations are available for acceptance tests:
8485
| `find('.foo').html('foo')` | `this.element.querySelector('.foo').innerHTML = 'foo'` | `html.js` |
8586
| `find('.foo').each((index, elem) => {...})` | `this.element.querySelectorAll('.foo').forEach((elem, index) => {...})` | `each.js` |
8687

87-
If you want to run only selected transforms on your code, you can just the needed transform:
88+
If you want to run only selected transforms on your code, you can pick just the needed transform:
8889

8990
```bash
90-
jscodeshift -t ../ember-test-helpers-codemod/lib/transforms/click.js tests/integration
91+
jscodeshift -t ../ember-test-helpers-codemod/lib/transforms/acceptance/click.js tests/integration
92+
```
93+
94+
### ember-native-dom-helpers tests
95+
96+
These transformations are available tests based on `ember-native-dom-helpers`:
97+
98+
| Before | After | Transform |
99+
|---------------------------------------|-----------------------------------------------|----------------|
100+
| `find('.foo')` | `this.element.querySelector('.foo')` | `find.js` |
101+
| `findAll('.foo')` | `this.element.querySelectorAll('.foo')` | `find.js` |
102+
| ```import { click, find, findAll, fillIn, focus, blur, triggerEvent, keyEvent, waitFor, waitUntil } from 'ember-native-dom-helpers';``` | ```import { click, find, findAll, fillIn, focus, blur, triggerEvent, triggerKeyEvent, waitFor, waitUntil } from '@ember/test-helpers';``` | `migrate-imports.js` |
103+
104+
If you want to run only selected transforms on your code, you can pick just the needed transform:
105+
106+
```bash
107+
jscodeshift -t ../ember-test-helpers-codemod/lib/transforms/native-dom/find.js tests/integration
91108
```
92109

93110

0 commit comments

Comments
 (0)