Don’t ever change tests.
There you go I just wrote a test that will always pass. THAT is why you don’t change tests, and ideally in the real world ( as in for paid $$$ work ) it should generally be expected that a “design spec” will define “unit tests” and a shape of an API, and it will be your job to “fill in the detail” as it were.
This is exactly why this course is presented in this way, with a “Ticket” raised for an issue, a skeleton API, and your job to fill in the parts that are needed to make that API work.
The task here is to actually update all the data in the collection.
You edit and run the script at:
/src/migrations/movie-last-updated.js just like the question tells you to do. The field is of course called
lastupdated ( all in lower case ) and not to be confused with
lastUpdated, which is present in some of the documents. But that’s not the field you want here.
Then when the data is actually updated as expected, both the unit test and the
/status page test will verify that the data they are expecting to have a “converted date” value. The migration is supposed to update ALL of the data that are presently “strings” to BSON
Date objects, but the tests themselves are just looking at two individual documents.
Please read the other threads that mention migration. You’re not the first to do this, and you are not the first to ask. Actually reading will give you tips and help you, and most importantly help you avoid asking the “same questions” that others have already asked again.