Skip to content

Tests, ESM, TS, dead code #573

@abignell

Description

@abignell

Thank you for reg-cli! We use it extensively for our visual regression testing.

I've recently gone ahead and updated our fork of this repo to:

  • Remove flow and use TypeScript
  • Replace prettier with biome (for linting and formatting with a close to default config)
  • Update to ESM
  • Fixed dead code
  • Fixed mistakenly commited .only in test?
  • Updated CI to run typecheck and biome lint/format checks
  • Bumps md5-file to v5 with ESM support

Note: we use yarn v4, which causes some issues when the build-ui.sh script clones the ui report builder and has yarn install --frozen-lockfile run as it wants to update the lock file, so I had to remove the --frozen-lockfile/--immutable option just for that, but it's somewhat negligible.

Tests are only executing 1 test, after removing the .only on the CLI tests everything seems to work, I suspect the .only was mistakenly committed and pushed to the main repo here, but it means that the testing is not currently reliable.

There's some dead code cleanup, for example, when calling copyImages the diffDir is passed in, however copyImages doesn't use it - there are minor issues like this throughout the code. Updating to TypeScript and biome exposes a lot of these problems.

Overall this improves quality and maintainability, albeit it sacrifices support to older Node versions.

You can find the PR where these modernised changes were made:

abignell#4

Feel free to borrow any of the updates / changes, or if anyone else wants to take them on board. 👍

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions