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

Add option to create a custom data type #121

Merged
merged 3 commits into from
Jul 28, 2022

Conversation

alexanderwe
Copy link
Contributor

Hey all,

at first thanks a lot for this great library! I saw that it is not possible to easily extend Mock.DataType with custom ones. Therefore I try to solve this issue with this PR. I changed the type from enum to struct to give consumers the ability to create new instances of DataType.

Furthermore I already created static variables on the DataType to not break any existing code with the types that were previously already in the library.

I needed this particular feature, because I also want to test my network responses if they return a specific kind of content type.

I would very appreciate if you could have a look into this :) Also happy for any feedback here !

Copy link
Contributor

@AvdLee AvdLee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot, I got some minor (nit) changes that I wish to see changed, but other than that we're good! I'm looking into running CI.

README.md Show resolved Hide resolved
Sources/Mock+DataType.swift Outdated Show resolved Hide resolved
Sources/Mock+DataType.swift Outdated Show resolved Hide resolved
Sources/Mock+DataType.swift Outdated Show resolved Hide resolved
Sources/Mock+DataType.swift Outdated Show resolved Hide resolved
@alexanderwe
Copy link
Contributor Author

Thanks a lot, I got some minor (nit) changes that I wish to see changed, but other than that we're good! I'm looking into running CI.

Thanks a lot for taking a look that fast ! Updated the PR with your suggestions

@alexanderwe alexanderwe requested a review from AvdLee July 26, 2022 12:18
@wetransferplatform
Copy link
Collaborator

Messages
📖

View more details on Bitrise

📖 MockerTests: Executed 25 tests (0 failed, 0 retried, 0 skipped) in 1.714 seconds

SwiftLint found issues

Severity File Reason
Error Mock.swift:8 Line should be 160 characters or less: currently 177 characters (line_length)
Warning Mock.swift:49 Line should be 140 characters or less: currently 155 characters (line_length)
Error Mock.swift:81 Line should be 160 characters or less: currently 211 characters (line_length)
Error Mock.swift:84 Line should be 160 characters or less: currently 208 characters (line_length)
Error Mock.swift:93 Line should be 160 characters or less: currently 287 characters (line_length)
Warning Mock.swift:122 Line should be 140 characters or less: currently 142 characters (line_length)
Warning Mock.swift:129 Line should be 140 characters or less: currently 141 characters (line_length)
Error Mock.swift:136 Line should be 160 characters or less: currently 246 characters (line_length)
Error Mock.swift:137 Line should be 160 characters or less: currently 236 characters (line_length)
Warning Mock.swift:148 Line should be 140 characters or less: currently 150 characters (line_length)
Warning Mock.swift:149 Line should be 140 characters or less: currently 153 characters (line_length)
Warning Mock.swift:185 Line should be 140 characters or less: currently 159 characters (line_length)
Error Mock.swift:195 Line should be 160 characters or less: currently 168 characters (line_length)

Code Coverage Report

Name Coverage
Mocker.framework 87.93%

Generated by 🚫 Danger Swift against bde6940

@AvdLee AvdLee merged commit 5d86f27 into WeTransfer:master Jul 28, 2022
@wetransferplatform
Copy link
Collaborator

Congratulations! 🎉 This was released as part of Release 2.6.0 🚀

Generated by GitBuddy

@alexanderwe
Copy link
Contributor Author

@AvdLee Thanks a lot for approving and already releasing it. Really appreciate it 🙂

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.

3 participants