react-native-file-access icon indicating copy to clipboard operation
react-native-file-access copied to clipboard

Add tests

Open alpha0010 opened this issue 3 years ago • 6 comments

See discussion in #16.

alpha0010 avatar Apr 20 '21 14:04 alpha0010

If I have time this week, I'd start to look into unit testing for Swift if you don't mind.

MegaMaddin avatar Apr 20 '21 19:04 MegaMaddin

Would be great if you have time to get a start on tests.

alpha0010 avatar Apr 20 '21 21:04 alpha0010

Just as an update, I tried to get unit testing running the last 1.5 days and it seems to be non straight forward (with XCode and all the pods setup) :-)

Probably need to consult a proper iOS dev for that :D

MegaMaddin avatar May 05 '21 09:05 MegaMaddin

Thanks for your efforts.

I had been thinking, perhaps it would be easier to create a page in the example app that when viewed, runs tests. This would not be automated for CI. However, should be much simpler to test majority of features during development.

alpha0010 avatar May 05 '21 13:05 alpha0010

perhaps it would be easier to create a page in the example app that when viewed, runs tests

That sounds like a plan too.

Also I made some progress and have the first test implemented :) (stupid XCode naming was the thing bothering me). But tbh, while looking over the code, most of the native calls are wrappers around FileManager (at least on iOS) and it was hard for me to come up with some useful tests for those scenarios. The one I created now, because it was "simple" to test and there's at least some logic, was for isDir ().

The question is, would it make sense to PR this anyway? It might make sense in the future and having the setup makes it easy to add tests later on.

MegaMaddin avatar May 05 '21 14:05 MegaMaddin

I created the branch automated-ci. Could you target a PR at it? Keeping your testing structure implementation around is likely to be useful in the future.

However for the time being, I think a test page in the example app is the way to go.

alpha0010 avatar May 10 '21 15:05 alpha0010