freshollie / jest-dynalite

Jest preset to run Dynalite (DynamoDB local) per test runner
https://www.npmjs.com/package/jest-dynalite
MIT License
151 stars 16 forks source link

babel-jest 28 & jest 28: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined #82

Closed vincent-ogury closed 2 years ago

vincent-ogury commented 2 years ago

I've upgrade babel-jest and jest to version 28.

-    "babel-jest": "^27.3.1",
+    "babel-jest": "^28.0.2",
-    "jest": "^27.3.1",
+    "jest": "^28.0.2",
     "jest-dynalite": "^3.4.4",

I've got this error with jest-dynalite now:

    TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined

      at ../node_modules/jest-dynalite/dist/config.js:23:29
          at Array.find (<anonymous>)
      at findConfigOrError (../node_modules/jest-dynalite/dist/config.js:22:79)
      at Object.setConfigDir (../node_modules/jest-dynalite/dist/config.js:47:5)
      at Object.exports.default (../node_modules/jest-dynalite/dist/setup.js:5:14)
      at new DynaliteEnvironment (../node_modules/jest-dynalite/dist/environment.js:17:28)
freshollie commented 2 years ago

Hmm, I wonder if jest@28 doesn't provide rootDir on the project config:

https://github.com/freshollie/jest-dynalite/blob/master/src/environment.ts#L13

Thanks for the report, will look into it when I can. Feel free to submit a PR if you can work this out

freshollie commented 2 years ago

Verified. Not sure why it's not listed, but jest 28 does break some stuff. I've updated to jest 28, and ensured backwards compatibility with an e2e test against jest 27. Will be published as v3.5.1 later today

vincent-ogury commented 2 years ago

Great !. I'm gonna test this right away. thanks.

freshollie commented 2 years ago

This fix should be out. Feel free to reopen if this doesn't work for you

vincent-ogury commented 2 years ago

I'm update jest+babel-jest + jest-dynalite After few readjustment, all works.

Thanks a lot.

freshollie commented 2 years ago

What were the re-adjustments?