Ticket: Migration Test Failed

FAIL test/migration.test.js
Migration
× migration (329ms)

● Migration › migration

expect(received).not.toBeNull()

Received: null

  12 |       lastupdated: { $type: "date" },
  13 |     })
> 14 |     expect(movie).not.toBeNull()
     |                       ^
  15 |   })
  16 | })
  17 |

  at toBeNull (test/migration.test.js:14:23)
  at tryCatch (node_modules/regenerator-runtime/runtime.js:62:40)
  at Generator.invoke [as _invoke] (node_modules/regenerator-runtime/runtime.js:296:22)
  at Generator.prototype.<computed> [as next] (node_modules/regenerator-runtime/runtime.js:114:21)
  at step (node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
  at node_modules/babel-runtime/helpers/asyncToGenerator.js:28:13

Test Suites: 1 failed, 1 total
Tests: 1 failed, 1 total
Snapshots: 0 total
Time: 2.218s
Ran all test suites matching /migration/i.
Teardown Mongo Connection
npm ERR! Test failed. See above for more details.

May I know did you fix it ? Because I am facing the same issue and not to able to pass my test.

Even I am facing the same issue, did anyone figure out how to solve this?

Post a screenshot that shows how you ran the migration.

I am also facing the same issue…

Hi @Aryan_Garg, can you please verify the following:

  1. You need to run the migration script from the main directory mflix-js. Otherwise, the config parameters like cluster uri and database name won’t be able to map.
  2. Also, verify the data type in the dataset of the lastupdated field. It should be still string. Sometimes, when trying to make the script work, we mistakenly update the dataset with the wrong data type to prevent running the script further. We are adding predicate with type: string in the query.
  3. Always check the error message carefully, after running the script, take a screenshot for sharing it in the forums or debugging it.

In case you have any doubts, please feel free to reach out to us.

Thanks and Regards.
Sourabh Bagrecha,
Curriculum Services Engineer