Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Make test fixtures into minitest tests #120

Copy link
Copy link
@kddnewton

Description

@kddnewton
Issue body actions

So! At the moment our test suite does a couple of things:

  1. Runs through each of the test fixtures (listed under test/cases) and prettier-ifies it using each of the configurations.
  2. Compares the generated code to the stored snapshot.
  3. Runs rubocop over the generated code to ensure it passes (with a rubocop config that matches the equivalent prettier configuration).

Recently I've added a fourth step for certain tests. That is that the test fixtures are themselves minitest tests, and it runs the tests after it prettier-ifies the code. The reason I did this was because:

  • previously the regexp modifiers worked
  • I changed some code and updated the snapshots and didn't realize that I had broken the modifiers
  • I pushed out a new version

We shouldn't rely on human inspection of the snapshots to ensure nothing broke. Instead, we should write tests! I've already converted over alias and regexp. That leaves the following fixtures:

  • alias
  • array
  • assign
  • binary
  • blocks
  • break
  • case
  • class
  • comments
  • defined
  • embdoc
  • encoding
  • hash
  • hooks
  • if
  • kwargs
  • lambda
  • layout
  • method
  • next
  • numbers
  • ranges
  • regexp
  • rescue
  • return
  • strings
  • super
  • while
  • yield

You can look at the ones that are already done as an example.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.