Comments (8)
Actually when I save file something interesting appears in output:
Running Mocha with Node.js at /usr/local/bin/node
Applying Mocha options:
{
"recursive": true
}
Test file(s):
0 passing (0ms)
###end
------------------------------------
finish failuare amount:0
------------------------------------
Usually I run my tests via yarn test
or npm test
which invoke following command: mocha -r dotenv/config --recursive ./test dotenv_config_path=.env.test
. I've added some options to workspace settings:
"mocha.options": {
"recursive": true
},
"mocha.requires": ["dotenv/config"]
not sure how can I pass dotenv_config_path=.env.test
to mocha.
from mocha-sidebar.
Do you have some sample code that I can test and debug it for you tks
from mocha-sidebar.
@nicck does your tests running from mocha command line?
from mocha-sidebar.
I've created a small repo to show the problem: https://github.com/nicck/mocha-sidebar-test-app
~/Code/testapp master
❯ yarn
yarn install v0.27.5
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
Done in 0.83s.
~/Code/testapp master
❯ yarn test
yarn test v0.27.5
$ mocha -r dotenv/config --recursive ./test dotenv_config_path=.env.test
Warning: Could not find any test files matching pattern: dotenv_config_path=.env.test
env
✓ works
doit
✓ works
1) does not work
2 passing (12ms)
1 failing
1) doit does not work:
Error: Expected 123 to equal 321
+ expected - actual
-123
+321
at assert (node_modules/expect/lib/assert.js:29:9)
at Expectation.toEqual (node_modules/expect/lib/Expectation.js:81:30)
at Context.it (test/app/doit.test.js:18:29)
error Command failed with exit code 1.
it works from command line as expected.
from mocha-sidebar.
@maty21 please let me know if I can help with reproducing this issue or you need any more details.
from mocha-sidebar.
Tks man I will debug it in the weekend :)
from mocha-sidebar.
@nicck We need to figure out how to support dotenv, but as a workaround you could add the env from the file to mocha.env
settings.
I was able to get your tests to run with these settings:
{
"mocha.requires": [
"dotenv/config"
],
"mocha.options": {
"recursive":true
},
"mocha.env": {
"NODE_ENV":"test",
"OAUTH_CLIENT_ID":987
}
}
from mocha-sidebar.
fixed in version 0.14.30
from mocha-sidebar.
Related Issues (20)
- Command 'mocha-maty.refreshExplorer' not found (again) HOT 4
- v0.22.2 isn't tagged (?)
- ge report html nyc mocha
- Failed test error message persisting through successful test run
- Extension issue
- It doesn't run my setup/global file as mocha does HOT 3
- Test failure results not displayed anywhere
- Unit tests (usually) do not attach to debugger unless the focus is on the file that is being tested - Inconsistent
- Feature request: configure different run command for tests in a given directory by placing a config file in the directory
- Crashes
- Debug/run a single TypeScript test from Sidebar fails HOT 1
- cannot run es6 modules based tests HOT 3
- Mocha sidebar extension issue in VSCode HOT 1
- Does this repo have any maintenance at all?
- cant find nyc locally HOT 2
- Click for coverage fails with 'ReferenceError: suite is not defined'
- cannot find module when importing json file in nodejs application
- Is this project abandoned? Alternatives? HOT 2
- support for c8 coverage tool
- [Typescript] "Run test at cursor" command fails with "Mocha is only available for JavaScript files."
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mocha-sidebar.