Codecov VSCode Extension Example
tl;dr
- Clone this repo
git clone [email protected]:codecov/example-typescript-vscode-extension.git
- Start working on your TypeScript project (only ts-code)
Guide
Travis Setup
Add to your .travis.yml
file.
language: node
before_install:
- if [ $TRAVIS_OS_NAME == "linux" ]; then
export CXX="g++-4.9" CC="gcc-4.9" DISPLAY=:99.0;
sh -e /etc/init.d/xvfb start;
sleep 3;
fi
script:
- npm run vscode:prepublish
- npm test
after_success:
- bash <(curl -s https://codecov.io/bash)
Producing Coverage Reports
Make sure you build your extension. In this case via tsc -p ./
or simply npm run vscode:prepublish
Add to coverconfig.json
:
{
"enabled": true,
"relativeSourcePath": "../src",
"relativeCoverageDir": "../../coverage",
"ignorePatterns": ["**/node_modules/**"],
"includePid": false,
"reports": ["json", "html", "lcov"],
"verbose": false
}
Run npm test
which runs node ./node_modules/vscode/bin/test
yo code
generated example
Differences to standard - Modified
test/index.ts
- the main testrunner rewritten completely - Changes in
stripts
anddevDependencies
section inpackage.json
coverconfig.json
added - small config file to change coverage settings localy.
Caveats
Private Repos
Add to your .travis.yml
file.
after_success:
- bash <(curl -s https://codecov.io/bash) -t uuid-repo-token
- More documentation at https://docs.codecov.io
- Configure codecov through the
codecov.yml
https://docs.codecov.io/docs/codecov-yaml
We are happy to help if you have any questions. Please contact email our Support at [email protected]