[hoodie-account-server] replace "pouchdb" with "pouchdb-core", "pouchdb-mapreduce" and "pouchdb-adapter-memory"
LowProfileDog opened this issue ยท comments
๐๐ป๐ Hacktoberfest: Trick or Treat!
If you havenโt yet, sign up for Hacktoberfest to earn an exclusive T-Shirt. Plus Iโm sure we can teach you a cool trick or two in the process
๐ค What you will need to know
You should have worked with JavaScript, Node.js and Testing. If you havenโt yet, we recommend the JavaScript Track on exercism.io
hoodie-account-server currently has PouchDB in its devDependencies. We need PouchDB for testing.
But pouchdb comes with all sorts of features that we donโt need, but they slow down the installation time and also install native dependencies that are sometimes hard to setup, especially on older windows machines.
Luckily, our friends at PouchDB created custom builds. That allows us to only pick exactly the features that we need, which are
๐ฏ The Goal
Minimise the installation time and requirements by replacing the pouchdb
package with the packages listed above.
๐ Step by Step
If this is your first, welcome ๐ ๐ Here is a great tutorial on how to send a pull request using the terminal.
- ๐ Claim this issue: Comment below (or assign yourself and continue at step 4 :)
Please ๐ only claim if you want to start working on it during the event.
Once claimed we add you as contributor to this repository. - ๐ Accept our invitation to this repository. Once accepted, assign yourself to this repository
- ๐ Please review our Code of Conduct
In a nutshell: be patient and actively kind with us ๐ - ๐ replace the
up for grabs
label within progress
. - ๐ Setup the repository locally make sure that all tests pass
- replace
pouchdb
with the other packages in package.json and tests/integration/utils/get-server.js#L6 - Commit the change with
test: replace pouchdb with custom build for testing
and push it either to your fork or push your new branch. - ๐ Start a Pull Request. Mention
closes hoodiehq/camp#59
in the description. - ๐ Done ๐ Replace the
in progress
label withready
. Ask in comments for a review :)
๐คโ Questions
Ping us in the Hoodie Chat or on Twitter
I can work on this!
I wrote the code required a while ago, but the testing process is kind of confusing, as it gets stuck at the Reading TAP data from stdin (use "-" argument to suppress)
part, where all it does is mirror what I write in stdin.
Thanks for looking into it @nistath The issue is all yours :) Iโve invited you to our Camp repository, you can accept my invitation at https://github.com/hoodiehq/camp/invitations
Once accepted, you can assign yourself to this issue and check off the checkboxes above. Enjoy ๐
Can you tell us your node & npm version? Run npm -v
and node -v
@LowProfileDog Here's what happens when I run the test.
$ npm test
@hoodie/account-server@0.0.0-semantically-released pretest C:\Users\Nick\Deskt op\hoodie\hoodie-account-server
standard
@hoodie/account-server@0.0.0-semantically-released test C:\Users\Nick\Desktop\ hoodie\hoodie-account-server
nyc tap 'tests/{unit,integration}/*/-test.js'
Reading TAP data from stdin (use "-" argument to suppress)
asdasdasdas
asdasdasdas
and it keeps mirroring my input forever.
The problem is that this works even if pouchdb is not installed. I have no idea if my new code works or not, although it is written according to the pouchdb documentation.
I'm on node 6.5.0 and npm 3.10.3 on Windows 8.
@nistath I donโt know why the test is behaving that way for you yet, Iโve never seen that behavior before.
One thinking mistake I found is that we donโt want the memory adapter, instead we want the http adapter, otherwise PouchDB wonโt send requests and our CouchDB mocks will stop working
You can also try to run a single test. Iโm not sure if itโs the same on Windows, but on mac you can execute the binary from the node_modules folder directly, for example
./node_modules/.bin/tap tests/integration/routes/no-cookie-header-test.js
Will only run the tests defined in tests/integration/routes/no-cookie-header-test.js
Can you check if that helps in any way?
yeah fix was simple, I updated your PR: hoodiehq/hoodie-account-server#213 and will merge it once CI passes, thanks :)
That specific test ran successfully. I think there's one test that does that, and goes in an infinite loop not letting the other tests run. Either that, or TAP has some issues.
all good, fixed via hoodiehq/hoodie-account-server#213