Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Librarys with deeper entrypoints: An unhandled exception occurred: Cannot find module '../../jest.config' #112

Open
andreElrico opened this issue Jun 9, 2022 · 0 comments

Comments

@andreElrico
Copy link

andreElrico commented Jun 9, 2022

Describe the bug
Seems not to work if we have a nested library.
Could fix it easily by changing the import path inside my library, in file jest-config.js

from
const baseConfig = require('../../jest.config');
to
const baseConfig = require('../../../jest.config');

To Reproduce

  1. have a library with name myComp/myFirstLibrary.
  2. run schematics
  3. run ng test
  4. look at error:
An unhandled exception occurred: Cannot find module '../../jest.config'
Require stack:
- C:\Users\xxxxxxxx\yyyyy\zzzz\projects\myComp\myFirstLibrary\jest.config.js
- C:\Users\xxxxxxxx\yyyyy\zzzz\node_modules\@angular-builders\jest\dist\custom-config.resolver.js
- C:\Users\xxxxxxxx\yyyyy\zzzz\node_modules\@angular-builders\jest\dist\index.js
- C:\Users\xxxxxxxx\yyyyy\zzzz\node_modules\@angular-devkit\architect\node\node-modules-architect-host.js
- C:\Users\xxxxxxxx\yyyyy\zzzz\node_modules\@angular-devkit\architect\node\index.js
- C:\Users\xxxxxxxx\yyyyy\zzzz\node_modules\@angular\cli\models\architect-command.js
- C:\Users\xxxxxxxx\yyyyy\zzzz\node_modules\@angular\cli\commands\test-impl.js
- C:\Users\xxxxxxxx\yyyyy\zzzz\node_modules\@angular-devkit\schematics\tools\export-ref.js
- C:\Users\xxxxxxxx\yyyyy\zzzz\node_modules\@angular-devkit\schematics\tools\index.js
- C:\Users\xxxxxxxx\yyyyy\zzzz\node_modules\@angular\cli\utilities\json-schema.js
- C:\Users\xxxxxxxx\yyyyy\zzzz\node_modules\@angular\cli\models\command-runner.js
- C:\Users\xxxxxxxx\yyyyy\zzzz\node_modules\@angular\cli\lib\cli\index.js
- C:\Users\xxxxxxxx\AppData\Roaming\npm\node_modules\@angular\cli\lib\init.js
See "C:\Users\xxxxxxxx\AppData\Local\Temp\ng-MsP1Ng\angular-errors.log" for further details.

Expected behavior
The schematics could realize the folder depth and set the correct import.

Additional context

    "@briebug/jest": {
      "version": "1.3.1",

    "@briebug/jest-schematic": {
      "version": "4.0.0",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant