ember-test-convert-object-selectors-codemod

0.1.3 • Public • Published

ember-test-convert-object-selectors-codemod

Contains a codemod to replace object selectors in assert.dom, find, click or fillIn with their corresponding string values.

Motivation

Selectors assigned to variables in tests can allow the selectors to be shared across multiple tests, and in fact across multiple test modules. However in a larger application, doing so can make tests harder to read, understand, and follow. Using the selector string instead of a variable keeps the test more atomic, allows the test to be more resilient when changes to the selector occur outside the test, and ensures the test is readable top-to-bottom.

Usage

To run a specific codemod from this project, you would run the following:

npx ember-test-convert-object-selectors-codemod <TRANSFORM NAME> path/of/files/ or/some**/*glob.js

# or

yarn global add ember-test-convert-object-selectors-codemod
ember-test-convert-object-selectors-codemod <TRANSFORM NAME> path/of/files/ or/some**/*glob.js

Transforms

Contributing

Installation

  • clone the repo
  • change into the repo directory
  • yarn

Running tests

  • yarn test

Update Documentation

  • yarn update-docs

Readme

Keywords

Package Sidebar

Install

npm i ember-test-convert-object-selectors-codemod

Weekly Downloads

0

Version

0.1.3

License

MIT

Unpacked Size

12.8 kB

Total Files

14

Last publish

Collaborators

  • nadinerao