Closed alexzbusko closed 2 years ago
Is this possibly becuase jest
, the jest-cli
or @types/jest
needs to be moved to dependencies (rather than devDependencies)?
"dependencies": {
"@taqueria/node-sdk": "^0.12.0",
"@taqueria/plugin-contract-types": "^0.10.0",
"async-retry": "^1.3.3",
"execa": "^6.1.0",
"fast-glob": "^3.2.7",
"jest-config": "^28.1.0"
},
"devDependencies": {
"@types/async-retry": "^1.3.3",
"@types/jest": "^27.5.1",
"tsup": "^6.1.3",
"typescript": "4.7.2",
"jest": "^28.1.0",
"jest-cli": "^28.1.0"
},
@mweichert @GImbrailo @jchenche @AlirezaHaghshenas
I have performed extensive troubleshooting based on my hypothesis that the issue was an incorrect/missing node dependency. After trying every permutation of Jest dependencies/devDependencies (jest, ts-jest , @types/jest, typescript, jest-config), and trying to install each on the main project; I'm at a dead end
It appears that the error we get:
npm WARN exec The following package was not found and will be installed: jest
● Validation Error:
Preset ts-jest not found.
Configuration Documentation:
https://jestjs.io/docs/configuration
Is actually due to a jest preset called ts-jest. It seems that if I manually install this package on my test project (npm i -D ts-jest), the plugin works as expected
Given that the dependency for ts-jest needs to be installed on the project not the plugin; I'm not sure how to resolve this. I'm not aware of how to solve this with node, but I assume we could check for and run the install command when the user runs taq test
@mweichert @ricklove , do you have any ideas as to the best way to resolve this?
What happened?
When initializing a taqueria project and wanting to add some tests you first install the jest plugin. If this project is initialized outside of the taqueria repo directory it will run into an issue where jest is not installed and it cannot find the ts-jest package
What should have happened?
We should install all jest dependencies/all things needed for the jest plugin to work as part of the installation process within a taqueria project
Steps to reproduce the bug
Steps to reproduce the error:
taq init {directory_name}
taq install @taqueria/plugin-jest
commandtaq test --init
taq test tests
Relevant log output
Screenshots and images
Screenshot and images
Code of Conduct