node-googlemaps icon indicating copy to clipboard operation
node-googlemaps copied to clipboard

Allow mocked google api for local development

Open antony opened this issue 8 years ago • 5 comments

I've been using this in my own project for a while but I thought it was due a pull request.

I like to be able to develop locally and also not hammer the google API during tests, so this allows a simple override of the gmaps api url using config.

antony avatar Apr 18 '16 21:04 antony

It looks like a good idea. Could you squash all your commits in 1

git rebase -i HEAD^^^
# replace pick with f for the commit you want to change
git commit --amend
git push origin master -f

Because you are making changes to the config I think these should be reported in the README. Could you please add some instructions on how to do add a custom url. I am curious to know how did you mock the Google map API server.

fabriziomoscon avatar May 09 '16 23:05 fabriziomoscon

I do a similar thing where I send in a custom request function to GoogleMapsAPI constructor. The custom request function sends back mock result data on disk similar to how the unit tests work.

evansiroky avatar May 10 '16 00:05 evansiroky

Hey @fabriziomoscon will do - sorry I only just saw this.

Btw did you know that github can squash commits now? The merge button above can be dropped down to choose 'squash and merge' :)

antony avatar Jun 24 '16 20:06 antony

@moshen I think squash and merge is an option that administrators can enable: https://github.com/blog/2141-squash-your-commits#whats-changing would you mind enable the checks from the admin page please?

fabriziomoscon avatar Jun 25 '16 07:06 fabriziomoscon

I've added the docs which should help you @fabriziomoscon understand how I mock the API in my own applications, but also provide help to others wanting to do something similar.

If you don't have squash+merge enabled I can squash it tonight ready for merge.

antony avatar Jun 29 '16 10:06 antony