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

Enable running brave-sync using node #34

Closed
garvankeeley opened this issue Jan 13, 2017 · 7 comments
Closed

Enable running brave-sync using node #34

garvankeeley opened this issue Jan 13, 2017 · 7 comments

Comments

@garvankeeley
Copy link

@garvankeeley garvankeeley commented Jan 13, 2017

Followup from #33, it would be amazing if brave-sync was runnable (unit-testable) using node.

This would provide clearer units (i.e. minimal functions) for me to implement, and also form a point of reference as a known good state.

Right now, when I am running into problems, I have too many points of failure/unknowns on iOS (thoughts such as: did I setup the code wrong, am I not calling code correctly on iOS, etc.). I could just compare what I am doing against running it on the command-line, and eliminate various possibilities that way.

@ayumi
Copy link
Contributor

@ayumi ayumi commented Jan 13, 2017

We currently unit test most client code except client/sync.js, the library - browser client interface. Is that the part you'd like to have tested?

@garvankeeley
Copy link
Author

@garvankeeley garvankeeley commented Jan 13, 2017

If I could run this on the command-line to login/init, then also on the command-line do some sync operations with a test data set, that would be sweet.
If I need a functional reference point, I want to avoid having to build brave browser and debug in that to compare how sync works in there to iOS (for instance if I am trying to find an implementation bug in iOS).
It isn't so much unit testing. It would be the ability to run it stand-alone in some form (which seems like a form of unit test for this lib).

@diracdeltas
Copy link
Member

@diracdeltas diracdeltas commented Jan 18, 2017

right now this is kind of tricky because client/sync.js depends on a bunch of window methods that are not natively available in node. if this is a blocker for you, i can make the client code fully isomorphic.

@garvankeeley
Copy link
Author

@garvankeeley garvankeeley commented Jan 18, 2017

No, not a blocker. Is there plans to make the sync lib stand-alone testable? If so, I could wait for that. It will be much easier to have something I can easily compare against and experiment with while I am implementing.

@diracdeltas
Copy link
Member

@diracdeltas diracdeltas commented Jan 18, 2017

Is there plans to make the sync lib stand-alone testable

It is already testable in a window environment, see `npm run browsertest' for instance. we did not have plans to make it testable via command-line node, but that is doable. i am not sure how useful that would be for you since the node JS environment is probably very different from the iOS webview JS environment

@garvankeeley
Copy link
Author

@garvankeeley garvankeeley commented Jan 18, 2017

cool i'll take a look at browsertest

since the node JS environment is probably very different from the iOS webview JS environment

Agreed, I would think that switching back and forth between a lightweight known-good test env and iOS code will ease implementation. It can help to point in the right direction as to source of a problem.

@diracdeltas
Copy link
Member

@diracdeltas diracdeltas commented Nov 20, 2018

Closing this unless further action is needed

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

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.