Bhaumin
Bhaumin3w ago

How to run mocha with deno

How can we run mocha test cases in deno? I have one project created with node and making it compatible with deno. all my test cases has been written in node mocha. so similar way if i try to run deno run test:mocha with the tasks inside deno.json
...
"test:deno": "mocha"
...
...
"test:deno": "mocha"
...
Getting below error
deno run test:deno

Task test:deno mocha
error: unexpected argument '--loader' found

tip: a similar argument exists: '--reload'
tip: to pass '--loader' as a value, use '-- --loader'

Usage: deno run --reload[=<CACHE_BLOCKLIST>...] [SCRIPT_ARG]...
deno run test:deno

Task test:deno mocha
error: unexpected argument '--loader' found

tip: a similar argument exists: '--reload'
tip: to pass '--loader' as a value, use '-- --loader'

Usage: deno run --reload[=<CACHE_BLOCKLIST>...] [SCRIPT_ARG]...
2 Replies
marvinh.
marvinh.3w ago
{
"tasks": {
"test:deno": "deno run -A npm:mocha"
}
}
{
"tasks": {
"test:deno": "deno run -A npm:mocha"
}
}
Bhaumin
Bhaumin3w ago
still getting same error with below deno.json file
{
"unstable": [
"bare-node-builtins",
"byonm"
],
"tasks": {
"test:deno": "deno run -A npm:mocha"
}
}
{
"unstable": [
"bare-node-builtins",
"byonm"
],
"tasks": {
"test:deno": "deno run -A npm:mocha"
}
}
@marvinh. can you please help us here, it's blocker for us so...please