Skip to content

Latest commit

 

History

History
33 lines (26 loc) · 1.68 KB

00-introduction.md

File metadata and controls

33 lines (26 loc) · 1.68 KB

Introduction

We will create a codemod called ember-codemod-rename-test-modules. It helps end-developers (our users) standardize the names of their test modules in an Ember app, addon, or engine.

/* Before: Module names are inconsistent (thanks to copy-paste) */
module('Integration | Component | ui/form', function (hooks) {});
module('Integration | Component | ui | form | field', function (hooks) {});
module('Integration | Component | <Ui::Page>', function (hooks) {});
/* After: Module names follow the conventions of Ember CLI */
module('Integration | Component | ui/form', function (hooks) {});
module('Integration | Component | ui/form/field', function (hooks) {});
module('Integration | Component | ui/page', function (hooks) {});

The codemod is practical (i.e. end-developers can now use --filter to run a group of related tests) and has the right scope—enough to cover the essentials (e.g. take small steps, read and write files, refactor code), but not too large to overwhelm you.

Table of contents

  1. Create a project
  2. Understand the folder structure
  3. Sketch out the solution
  4. Step 1: Update acceptance tests (Part 1)
  5. Step 1: Update acceptance tests (Part 2)
  6. Step 2: Update integration tests
  7. Step 3: Update unit tests
  8. Refactor code (Part 1)
  9. Refactor code (Part 2)
  10. Conclusion