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

Comments

Close side panel

Refactor CreateAPITests structure and snapshotting#128

Merged
liamnichols merged 5 commits intomainCreateAPI/CreateAPI:mainfrom
ln/snapshotting-refactorsCreateAPI/CreateAPI:ln/snapshotting-refactorsCopy head branch name to clipboard
Aug 8, 2022
Merged

Refactor CreateAPITests structure and snapshotting#128
liamnichols merged 5 commits intomainCreateAPI/CreateAPI:mainfrom
ln/snapshotting-refactorsCreateAPI/CreateAPI:ln/snapshotting-refactorsCopy head branch name to clipboard

Conversation

@liamnichols
Copy link
Member

@liamnichols liamnichols commented Aug 8, 2022

While working on the above PR, I had to shift some stuff around so I decided that it would be better to do some refactoring beforehand to get everything that I wanted into place.

In this change, I do the following:

  1. Introduce a new Snapshotter class that replaces the old compare(expected:actual:) global function.
  2. Move test helpers (TemporaryDirectory) into Helpers directory
  3. Remove generated snapshots, test specs and AllPackages out of ./Tests/CreateAPITests and into a new ./Tests/Support directory
    • I wasn't a big fan on having to manage excludes to keep the files from being compiled etc.
  4. Move the GenerateTestCase.SpecFixture type into its own file at ./Helpers/SpecFixture.swift now that we have some room to breathe with helpers
Before After
Before After

@LePips
Copy link
Contributor

LePips commented Aug 8, 2022

Occam's Razor, was gonna look at implementing the same thing.

@liamnichols liamnichols merged commit 0069e8b into main Aug 8, 2022
@liamnichols liamnichols deleted the ln/snapshotting-refactors branch August 8, 2022 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

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