-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Bundle mocha with webpack to extend functionality #4516
Closed
4 tasks done
Labels
status: accepting prs
Mocha can use your help with this one!
type: bug
a defect, confirmed by a maintainer
Comments
would accept a PR which changes |
This was referenced Nov 25, 2020
Merged
@boneskull Please review the PR. The GUI tests seem to be stuck. They''ve been running now for almost 5 hours. |
@boneskull any update? |
@boneskull please have a look at my PR and merge accordingly |
@outsideris would you please review my PR and merge? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
status: accepting prs
Mocha can use your help with this one!
type: bug
a defect, confirmed by a maintainer
Prerequisites
faq
labelnode node_modules/.bin/mocha --version
(Local) andmocha --version
(Global). We recommend that you not install Mocha globally.Description
I am working on Angular 2 with Cypress. I would like to extend mocha's functionality to add a custom metadata object inside it() and describe(). To do this, i obviously need to require mocha. Code: https://github.com/devhazem/mocha-test-options/blob/master/index.js
When doing this, I get the following error (even though the file does exist):
Error: Webpack Compilation Error C:/app/node_modules/mocha/lib/browser/growl.js Module not found: Error: Can't resolve '../../package' in 'C:\app\node_modules\mocha\lib\browser' resolve '../../package' in 'C:\app\node_modules\mocha\lib\browser' using description file: C:\app\node_modules\mocha\package.json (relative path: ./lib/browser) using description file: C:\app\node_modules\mocha\package.json (relative path: ./package)
How can I achieve this?
Steps to Reproduce
declare module mocha-test-options: export function describe(title: string, metadata: object, fn); export function it(title: string, metadata: object, fn);
Expected behavior: should not throw any errors
Actual behavior:
Error: Webpack Compilation Error C:/app/node_modules/mocha/lib/browser/growl.js Module not found: Error: Can't resolve '../../package' in 'C:\app\node_modules\mocha\lib\browser' resolve '../../package' in 'C:\app\node_modules\mocha\lib\browser' using description file: C:\app\node_modules\mocha\package.json (relative path: ./lib/browser) using description file: C:\app\node_modules\mocha\package.json (relative path: ./package)
Reproduces how often: All the time
Versions
mocha: 8.2.0
typescript: "3.9.4"
The text was updated successfully, but these errors were encountered: