mochapack icon indicating copy to clipboard operation
mochapack copied to clipboard

[Feature] Implement the `require` interface

Open sebastienfilion opened this issue 5 years ago • 3 comments

Hey there @vlasenko first of all, thanks for this fork, works great. Would you consider implementing the require interface? https://mochajs.org/#require It seems like only bdd, tdd, qunit and exports were implemented.

sebastienfilion avatar Apr 02 '19 14:04 sebastienfilion

@sebastienfilion Have you tried to run it with mochapack -u require ... ?

larixer avatar Apr 03 '19 03:04 larixer

Yes I have and I get an error saying that require is not a module; Is it an issue with my Webpack configuration? I just never knew that feature to be an external module.

Error: Cannot find module 'PATH_TO_PROJECT/require'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
    at Function._resolveFilename (/usr/local/lib/node_modules/mochapack/lib/util/registerRequireHook.js:44:34)
    at Function.resolve (internal/modules/cjs/helpers.js:30:19)

sebastienfilion avatar Apr 04 '19 16:04 sebastienfilion

@sebastienfilion Can you give this a shot using 2.0.0? If it works and you don't run into an issue similar to #65 then we can resolve this issue.

Thanks

Jack-Barry avatar May 06 '20 20:05 Jack-Barry