Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove test method prefix from reference files #39

Open
Jeehut opened this issue Feb 19, 2018 · 3 comments
Open

Remove test method prefix from reference files #39

Jeehut opened this issue Feb 19, 2018 · 3 comments

Comments

@Jeehut
Copy link
Contributor

Jeehut commented Feb 19, 2018

Currently, when I follow the XCTest naming guidelines and write test names like this:

    func testBasicRendering() {
        expect(snapshotView).toMatchSnapshot()
    }

I get files named like this:

I would have expected the name to be reference_basicrendering, so the test prefix should be removed as it is part of any test method. It's redundant information.

@skyweb07
Copy link
Owner

Hey mate, thanks for the feedback, I think we can make that option configurable so it's opt-in and the current tests for users don't break, also, I don't know if you know that you can pass a custom name to any snapshot like this

expect(snapshotView).toMatchSnapshot(named: "basic_rendering")

@Jeehut
Copy link
Contributor Author

Jeehut commented Feb 21, 2018

I know that, but I think the defaults should definitely be more swifty or at least provide the option to be so. Another possibility is that we keep support for the test prefix when matching, but only create new references without the test prefix. That way existing tests would still work but the redundant stuff would be gone long term.

@skyweb07
Copy link
Owner

Yeah, I think we can do something like that using the Snap Config so it's opt-in by the user, I'll try to do that this afternoon

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

No branches or pull requests

2 participants