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

Expand tests: If it can be tested it should be tested #35

Open
JamesLongman opened this issue Mar 9, 2018 · 1 comment
Open

Expand tests: If it can be tested it should be tested #35

JamesLongman opened this issue Mar 9, 2018 · 1 comment

Comments

@JamesLongman
Copy link
Owner

JamesLongman commented Mar 9, 2018

While working on #5 adding initial tests for the project I have come across several functions that are not of the form function (input) { code; return result}, instead most of the offending code is of the form function(input) {code; someOtherClassOrObject.resultingAction() }. The lack of return makes testing difficult and often requiring the use of stubs. Upon a quick search I haven't found any source that simply explains stubbing in swift so for now I am going to add all code requiring tests through this method here.

It would be possible and indeed easier to test a lot of these functions by returning and I have done this in the past whilst writing tests for a node project; but performance is a huge concern with an IOS project and compromising performance would go against the very reason for introducing tests in the first place which is to help ensure a better final project.

This issue will remain open until either tests are added or points can be proved untestable (personally I think this is unlikely) but this is low priority

Currently tracked files marked with TODOs where tests are needed, search project for #35 to find comments

@JamesLongman JamesLongman changed the title Add test for UILabel extension Add tests where stubs are required Mar 10, 2018
JamesLongman pushed a commit that referenced this issue Mar 10, 2018
@JamesLongman JamesLongman changed the title Add tests where stubs are required Expand tests: If it can be tested it should be tested Mar 19, 2018
@JamesLongman
Copy link
Owner Author

Branch is actually up for this issue with some work done. Mildly blocked by #6 as I wanted to remove LTMorphingLabel from the project and use a vanilla animation instead. Probably also worth taking a look at the coverage and excluding tests and podfiles from weighing in on the calculation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant