Include JavaScript files that the test depends on to run in MochaJS

1

I'm developing a client-side JavaScript application, and I want to do some testing using MochaJS , but the test relies on multiple files JavaScript to run, which are in different folders, such as:

Files needed to run the test:

js/a.js 
js/b.js 

vendor/js/c.js

Test file:

test/test.js

My question would be: what is the simplest way to include these dependencies in the test file.

I found a way to do this using "require" only this would lead to modifying the code to run with nodejs using things like "module.exports" and in my case the code would run in the browser.

Another way I found was "RequireJS" but in that case it would be necessary to include the script in an HTML file, and that would not be very useful.

    
asked by anonymous 07.10.2016 / 07:43

0 answers