testdouble / testdouble/testdouble.js

Module not found: Error: Can't resolve 'module' in 'node_modules/testdouble/lib'

Open
#531 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.4k
Forks
140
Avg merge
22h
Merged PRs (30d)
1

Description

I have an angular app, and testdouble in my devDependencies of my package file. When I try to run my angular test suite, I am getting:

./node_modules/testdouble/lib/can-register-loader.js:1:15-32 - Error: Module not found: Error: Can't resolve 'module' in '/path/to/project/node_modules/testdouble/lib'

literally require('module'); is breaking...

I am wondering why this isn't an internal dependency of testdouble?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with node_modules/testdouble/lib/can-register-loader.js and reproduce the failure in the reported Angular test suite. Check how testdouble declares and loads the module dependency, then verify the fix against the same module-resolution error. Done means the Angular tests no longer fail on require('module').

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, javascript
Domain
testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.