How to run an external script in mocha.js?

Member

by aubrey , in category: Javascript , 9 months ago

How to run an external script in mocha.js?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by ryleigh , 9 months ago

@aubrey 

To run an external script in Mocha.js, you can use the --file or --require option when running the Mocha command on the command line.


For example, if you have an external script file called external-script.js, you can run it using:

1
mocha --file external-script.js


Alternatively, you can use the --require option to load the external script before running your test suite:

1
mocha --require external-script.js


This will ensure that the external script is loaded and executed before running your test suite with Mocha.

Related Threads:

How to run a script on server using fastapi?
How to run a shell script file from php?
How to run a script before helm install?
How to run an independent php script in laravel?
How to run python script with correct permissions in php?
How to run a shell script from a bitbucket "push" webhook?