|
| 1 | +# ember-test-helper-api-migration |
| 2 | +This codemod transfer is to migrate deprecated package `ember-test-helpers` to package `@ember/test-helpers` |
| 3 | + |
| 4 | +## Usage |
| 5 | + |
| 6 | +``` |
| 7 | +npx ember-test-helpers-codemod ember-test-helper-api-migration path/of/files/ or/some**/*glob.js |
| 8 | +
|
| 9 | +# or |
| 10 | +
|
| 11 | +yarn global add ember-test-helpers-codemod |
| 12 | +ember-test-helpers-codemod ember-test-helper-api-migration path/of/files/ or/some**/*glob.js |
| 13 | +``` |
| 14 | + |
| 15 | +## Input / Output |
| 16 | + |
| 17 | +<!--FIXTURES_TOC_START--> |
| 18 | +* [basic](#basic) |
| 19 | +* [do-not-have-@ember-test-helpers-import](#do-not-have-@ember-test-helpers-import) |
| 20 | +* [do-not-have-ember-test-helpers-import](#do-not-have-ember-test-helpers-import) |
| 21 | +<!--FIXTURES_TOC_END--> |
| 22 | + |
| 23 | +<!--FIXTURES_CONTENT_START--> |
| 24 | +--- |
| 25 | +<a id="basic">**basic**</a> |
| 26 | + |
| 27 | +**Input** (<small>[basic.input.js](transforms/ember-test-helper-api-migration/__testfixtures__/basic.input.js)</small>): |
| 28 | +```js |
| 29 | +import { setApplication } from '@ember/test-helpers'; |
| 30 | +import { start } from 'ember-qunit'; |
| 31 | +import { setResolver } from 'ember-test-helpers'; |
| 32 | +``` |
| 33 | + |
| 34 | +**Output** (<small>[basic.input.js](transforms/ember-test-helper-api-migration/__testfixtures__/basic.output.js)</small>): |
| 35 | +```js |
| 36 | +import { setApplication, setResolver } from '@ember/test-helpers'; |
| 37 | +import { start } from 'ember-qunit'; |
| 38 | +``` |
| 39 | +--- |
| 40 | +<a id="do-not-have-@ember-test-helpers-import">**do-not-have-@ember-test-helpers-import**</a> |
| 41 | + |
| 42 | +**Input ** (< small> [[email protected]](transforms/ember-test-helper-api-migration/__testfixtures__/[email protected])</ small>): |
| 43 | +```js |
| 44 | +import { start } from 'ember-qunit'; |
| 45 | +import { setResolver } from 'ember-test-helpers'; |
| 46 | +``` |
| 47 | + |
| 48 | +**Output ** (< small> [[email protected]](transforms/ember-test-helper-api-migration/__testfixtures__/[email protected])</ small>): |
| 49 | +```js |
| 50 | +import { setResolver } from '@ember/test-helpers'; |
| 51 | +import { start } from 'ember-qunit'; |
| 52 | +``` |
| 53 | +--- |
| 54 | +<a id="do-not-have-ember-test-helpers-import">**do-not-have-ember-test-helpers-import**</a> |
| 55 | + |
| 56 | +**Input** (<small>[do-not-have-ember-test-helpers-import.input.js](transforms/ember-test-helper-api-migration/__testfixtures__/do-not-have-ember-test-helpers-import.input.js)</small>): |
| 57 | +```js |
| 58 | +import { moduleForComponent, test } from 'ember-qunit'; |
| 59 | +import hbs from 'htmlbars-inline-precompile'; |
| 60 | + |
| 61 | +moduleForComponent('foo-bar', 'Integration | Component | foo bar', { |
| 62 | + integration: true |
| 63 | +}); |
| 64 | +``` |
| 65 | + |
| 66 | +**Output** (<small>[do-not-have-ember-test-helpers-import.input.js](transforms/ember-test-helper-api-migration/__testfixtures__/do-not-have-ember-test-helpers-import.output.js)</small>): |
| 67 | +```js |
| 68 | +import { moduleForComponent, test } from 'ember-qunit'; |
| 69 | +import hbs from 'htmlbars-inline-precompile'; |
| 70 | + |
| 71 | +moduleForComponent('foo-bar', 'Integration | Component | foo bar', { |
| 72 | + integration: true |
| 73 | +}); |
| 74 | +``` |
| 75 | +<!--FIXTURE_CONTENT_END--> |
0 commit comments