-
Notifications
You must be signed in to change notification settings - Fork 2k
CRUD unit test not passing #1124
Comments
Is that reproducible only on your Windows machine? Can you specify the installed mongodb version you have? |
MongoDB version is the latest stable release, 3.2.0. I am indeed unsure whether this is a Windows issue (I don't have access to a Linux distro on which to reproduce it), or a change introduced in the latest Mongo release? The latter would make more sense, as I don't see why they would change the error syntax based on the OS... |
I am having the same issue on Windows 10 with mongodb 3.2.0 |
Right, have gotten around to testing it on Ubuntu 14.04, also MongoDB v3.2.0, and the errors are as expected:
Definitely a Windows issue! |
It's not a Windows issue, nor a Windows 10 issue. I've been using this project on Windows 7, for quite some time, and haven't ran into this issue. I just got a Windows 10 environment setup, and it's working for me there as well.. My guess is that it's the MongoDB version that is causing the issue. It could also be a mongoose issue. Can you share what versions of Node, NPM, and Mongoose you have installed? I may try to bump up my MongoDB version to match both of yours. |
Downgrading to MongoDB 3.0.8 solved the issue, cheers! Does anything need to be done wrt. 3.2.0 support on Windows? The same version works correctly on Ubuntu 14.04... |
It's hard to tell what the issue might be with that version of MongoDB & Windows 10; without extensive investigation. It could be a mongoose issue as well. We'd probably want to test with Windows 7 as well. There might be some useful info/discussions in Mongo's repo. That's probably the best place to start. |
Just to add to this...I'm seeing the same behavior on MacOS 10.11.2 with mongo 3.2.1 installed via Homebrew... $ mongod --version |
I had this issue a few times on ubuntu virtualised servers. Where there are no dependency issues I didn't see this, however where I installed and had issues with kerberos and ignored them running grunt server etc I saw this error repeatedly (by "repeatedly" I mean on different provisioned ubuntu instances (rather than the same instance re-issued with the same commands! :D)) Try installing node via nvm: I haven't seen half the issues since going this route! It could be related to default npm global prefix which nvm manages per node installed version. |
…ersions of mongodb. When running a newer version of mongodb, users are reporting an issue when executing tests because the response from the mongo request has changed. This change should support new/old versions of the test. Resolves meanjs#1124
Hi there,
I just yesterday cloned the MEANJS repo and installed the latest version of MongoDB on my Windows 10 machine.
Running the
grunt test:server
task throws an AssertionError when it gets toUser CRUD tests should not be able to update own user details with existing username
as well as for an existing email.In particular:
Username already exists
was expected11000 duplicate key error collection: mean-test.users index: username already exists
was receivedDigging around in the code, I found the following line in the
getUniqueErrorMessage
method inmodules/core/server/controllers/errors.server.controller.js
which should indeed fetch the actual field name:var fieldName = err.errmsg.substring(err.errmsg.lastIndexOf('.$') + 2, err.errmsg.lastIndexOf('_1'));
The search for an index of
.$
seems to corroborate the error MongoDB has thrown in the past, e.g.:E11000 duplicate key error index: mydb.users.$email_1 dup key: { : null }
Source
Can anyone reproduce this? Could it be that the test case simply isn't up to date with the latest releases of Mongoose/MongoDB? I'm happy to submit a PR if so, although I would suspect it be a breaking change for users still on an older version of Mongo.
Cheers!
The text was updated successfully, but these errors were encountered: