alpha0010 / react-native-file-access

Filesystem access for React Native
MIT License
307 stars 19 forks source link

Add tests #17

Open alpha0010 opened 3 years ago

alpha0010 commented 3 years ago

See discussion in #16.

MegaMaddin commented 3 years ago

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

alpha0010 commented 3 years ago

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

MegaMaddin commented 3 years ago

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

alpha0010 commented 3 years ago

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.

MegaMaddin commented 3 years ago

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.

alpha0010 commented 3 years ago

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.