-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.2.33
-
Component/s: MongoDB 3.4
-
Environment:TravisCI, Node (LTS/Latest Stable)
-
Empty show more show less
I am struggling with a mongodb bug. I am currently running some tests locally and running some tests on TravisCI.
Locally, all tests pass.
> jest --coverage PASS __test__/modules/Auth.test.js PASS __test__/modules/UserManager.test.js PASS __test__/TravisCI.test.js Test Suites: 3 passed, 3 total Tests: 7 passed, 7 total Snapshots: 0 total Time: 2.535s Ran all test suites.
However, on Travis, I get the following error:
● Auth Module › should authenticate a valid user expect(received).toEqual(expected) Expected value to equal: {"_id": "5a106615c7e216113c7940a0", "email": "test@test.com", "name": "Test User", "password": "$2a$12$Nug3WgSLqkZGRytfsJ16kOHvTPMmwGc7Ngpxx1fJrCg0dwMopWA5m"} Received: null Difference: Comparing two different types of values. Expected object but received null. at Object.it (__test__/modules/Auth.test.js:37:62) at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7)
I am looking up an object by ID but it is returning null, despite having just created it using collection.insert.
The code is open source, and the line that fails is here:
This is the corresponding travis fail:
Expected Behaviour is TravisCI test mimics my local test.