ashfurrow / Nimble-Snapshots

Nimble matchers for FBSnapshotTestCase.
https://medium.com/cocoaacademymag/unit-testing-uiview-with-nimble-snapshot-651a7c5a5e93
MIT License
319 stars 102 forks source link

Swift Package Manager - class name is not removed from snapshot image name #246

Closed woutergoossens closed 2 years ago

woutergoossens commented 2 years ago

We are updating our Carthage Implementation to SPM. With that change, our snapshots are invalid because the class name is not removed in the sanitizedName var in CurrentTestCaseTracker.

if let quickClass = NSClassFromString("QuickSpec"), self.isKind(of: quickClass) { --> will fail because QuickSpec does not exists. By using NSClassFromString in Swift, the module/app name should also be used so it should be NSClassFromString("Quick.QuickSpec").

BEFORE AccountDetailsLoadingView__should_show_a_standard_loadingView
AFTER MySpec_AccountDetailsLoadingView__should_show_a_standard_loadingView

Can that be updated in case of Swift Package Manager?

test project --> NimbleTest.zip

dogo commented 2 years ago

Hi @woutergoossens , working on it

dogo commented 2 years ago

@woutergoossens Please update to 9.4.0

woutergoossens commented 2 years ago

@woutergoossens Please update to 9.4.0

Thanks!