# Error when running the first test: npm test -t mongoclient

1. this test DOES NOT RUN correctly. the error message is ambiguous.
2. I’ve run this file from the root of the project mflix-js
3. the application runs with no problems but the status shows an incorrect return for the connection test and I don’t think the test is being executed because I put a console.log at the begining of the test.js file and nothing is being logged to the console
4. I’m using node v11.4

# .env file

# Ticket: Connection
# Rename this file to .ini after filling in your MFLIX_DB_URI and your SECRET_KEY
# Do not surround the URI with quotes
SECRET_KEY=super_secret_key_you_should_change
MFLIX_NS=mflix
PORT=5000


Please note the instruction to rename the file to “.INI” is wrong.

Did you upload the provided data into your cluster?

same thing with

npm test -t db-connection

I followed the instructions word for word and going over the instructions twice to make sure I did not miss anything

1. edited and renamed the .env file
2. restored the data from the mflix-js\data folder with mongorestore
3. run the npm install command to install all of the dependencies
4. executed the command npm run to start the application
5. executed the npm test -t db-connection command to run the test…

kabhoommm: no joy… one of my fat fingers must have gotten in the way somehow and I can’t see it or find the error of my ways, myBad…

could I be missing a plug-in or add-in somewhere,

after removing the node_modules, re-running the npm install and re-starting the app, now I get the number of documents error which I corrected by changing the expected document number to 44,999 now the test passes but I do not get the expected code back.

the great thing is that after reloading the database with the handouts for this lesson, the db_connection test passed, on to the projection test, and now I’m back to the GREAT, FAMILIAR Error,

Error: Plugin/Preset files are not allowed to export objects, only functions. In C:\Users\SPEXP\Downloads\mflix-js (1)\node_modules\babel-preset-stage-1\lib\index.js
at Array.map (<anonymous>)
npm ERR! Test failed.  See above for more details.


this is why I stopped in the middle of the last class, don’t have the time to debug error that don’t have to do with Mongo, or the data.

But it’s problably me

anywho Thank you, Great Class

Same problem here:

PS F:\MongoDBUniversity\M220\mflix-js> npm test -t db-connection

> server@1.0.0 test F:\MongoDBUniversity\M220\mflix-js
> jest --passWithNoTests "db-connection"

Error: Plugin/Preset files are not allowed to export objects, only functions. In F:\MongoDBUniversity\M220\mflix-js\node_modules\babel-preset-stage-1\lib\index.js
at createDescriptor (F:\MongoDBUniversity\M220\mflix-js\node_modules\@babel\core\lib\config\config-descriptors.js:178:11)
at items.map (F:\MongoDBUniversity\M220\mflix-js\node_modules\@babel\core\lib\config\config-descriptors.js:109:50)
at Array.map (<anonymous>)
at createDescriptors (F:\MongoDBUniversity\M220\mflix-js\node_modules\@babel\core\lib\config\config-descriptors.js:109:29)
at createPresetDescriptors (F:\MongoDBUniversity\M220\mflix-js\node_modules\@babel\core\lib\config\config-descriptors.js:101:10)
at presets (F:\MongoDBUniversity\M220\mflix-js\node_modules\@babel\core\lib\config\config-descriptors.js:47:19)
at mergeChainOpts (F:\MongoDBUniversity\M220\mflix-js\node_modules\@babel\core\lib\config\config-chain.js:320:26)
at F:\MongoDBUniversity\M220\mflix-js\node_modules\@babel\core\lib\config\config-chain.js:283:7
at buildRootChain (F:\MongoDBUniversity\M220\mflix-js\node_modules\@babel\core\lib\config\config-chain.js:120:22)
npm ERR! Test failed.  See above for more details.


How to resolve the issue “Error: Plugin/Preset files are not allowed to export objects, only functions” - look at the tread “All tests failed”

Hi, got that problem when i installed babel manualy, but couldnt solved it.

Instead, after “npm install” command i downgraded NodeJS to version 11.10.1 and continued with the course with no problem so far(Ticket Projection).

Looks like the last version of node have problems with certains libraries for the tests.

Actual Date: 15/03/2019 Arg.

So is there a known fix? I tried to reinstall node vs 11.10.1 and it didn’t resolve the issue. I was running v10.15.3. Same errors. It’s great to have a course like this available but more detail needs to be provided for configuration.