Jest config is throwing an error - not working properly

Jest encountered an unexpected token

This usually means that you are trying to import a file which Jest cannot parse, e.g. 
it's not plainJavaScript.

By default, if Jest sees a Babel config, it will use that to transform your files, 
ignoring "node_modules".

Here's what you can do:
• To have some of your "node_modules" files transformed, you can specify a 
custom "transformIgnorePatterns" in your config.
• If you need a custom transformation specify a "transform" option in your config.
• If you simply want to mock your non-JS modules (e.g. binary assets) you can 
stub them out with the "moduleNameMapper" config option.

You'll find more details and examples of these config options in the docs:
https://jestjs.io/docs/en/configuration.html

Details:  /Users/mariacam/Development/mflix-js/test/lessons/mongoclient.spec.js:1
({"Object 
<anonymous>":function(module,exports,require,__dirname,__filename,global,jest)    
{import { MongoClient } from "mongodb";
                                                                                            

SyntaxError: Unexpected token {

at ScriptTransformer._transformAndBuildScript (node_modules/jest- 
runtime/build/script_transformer.js:403:17)

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

I fixed the issue partially. The error I throw is due to my not doing the exercise yet. but the rest is working. Jest cannot use the import keyword. Only require. So I changed the following at the top of mongoclient.spec.js:

// import { MongoClient } from "mongodb"

const MongoClient = require('mongodb');

And got the following in the console when I ran the command

npm test -t mongoclient

npm test -t mongoclient                                                                      ⏎ ✭

> server@1.0.0 test /Users/mariacam/Development/mflix-js
> jest --passWithNoTests "mongoclient"

Determining test suites to run...Setup Mongo Connection
FAIL  test/lessons/mongoclient.spec.js
MongoClient
✓ Client initialized with URI (404ms)
✓ Client initialized with URI and options (240ms)
✓ Database handle created from MongoClient (289ms)
✕ Collection handle created from database handle (408ms)

● MongoClient › Collection handle created from database handle

expect(received).toBeNull()

Received: [Error: expect(received).toBe(expected) // Object.is equality

Expected: 46014
Received: 45993]
144 |       expect(numMoves).toBe(46014)
145 |     } catch (e) {
146 |       expect(e).toBeNull()

147 |     } finally {
148 |       testClient.close()
149 |     }

at Object.toBeNull (test/lessons/mongoclient.spec.js:146:17)

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