Example doesn't work
See original GitHub issueHi, I’ve cloned repository. Installed dependencies in example
folder. And when running yarn test
I get:
Validation Error:
Module jest-preset-angular should have "jest-preset.js" or "jest-preset.json" file at the root.
I see that this file is in root. I’ve also copied it to example folder and example/src but same error appears.
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
I don't know why this three.js example doesn't work
I'm currently using VS-Code & have two files : index.html and index.js By copying a simple example from threejs.org I can't seem to...
Read more >Nextjs example SSR doesnt work. · Issue #1735 - GitHub
In the nextjs-supabase-auth example the SSR functionality doesn't work. I can't get it to work either. In the API where the cookie is...
Read more >Example code does not work - Developing with Prismic
Hi community, I'm having problems getting the nextjs-starter-prismic-blog to work. The error is same as #52 issue.
Read more >24+ Reasons Code Doesn't Work & How To Fix It - WP SITES
Discover the most common reasons your CSS or PHP doesn't work or breaks your site when it really does work properly.
Read more >Request Form Example doesnt work - Appian Community
while in the interface parameters, that variable is empty: I tried to put the same structure....but it doesnt work, same error. So, after...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
have you run
yarn
in both root andexample/
directories?The reason is the symlink strategy by npm. In the example folder itself peerDependencies like
@angular/...
orcore-js
are installed, but not in the root folder of the library. We do not need them there to publish and test the library.When resolving dependencies, npm will only go UP and look for
node_modules
folders.As the symlink created by
npm
links upwards to../
, and ascore-js
is referenced in the preset in the parent folder, it will start to look for this dependency in the root folder<repo>/node_modules
and upwards, but not in<repo>/example/node_modules
. But it is not installed there.yarn
handles the sitation different. It actually copies the whole parent folder into<repo>/example/node_modules/jest-preset-angular
and thereforerequire('core-js')
in the preset can find the dependency in `<repo>/example/node_modules/core-js.There are four solutions if you want to try out the example app:
yarn
(install it usingnpm i -g yarn
)jest-preset-angular
version from npm, as @webdevelopland suggested usingnpm i -D jest-preset-angular@latest
example/node_modules
using from insideexample
: