README
codecov
code coverage service plugin for form8ion
Table of Contents
Features
Scaffold
- Define a coverage status badge to communicate current coverage details
- Link from the status badge to further details on the Codecov site
- Define a coverage status badge for private projects when an
apiAccessToken
string (optional) is provided
Lift
- Migrate from the legacy node uploader
to the modern uploader
- Currently supports the following CI Providers:
Usage
Installation
$ npm install @form8ion/codecov --save
Example
Import
import {packageManagers} from '@form8ion/javascript-core';
import {scaffold, lift} from '@form8ion/codecov';
Execute
(async () => {
await scaffold({
visibility: 'Public',
vcs: {
host: 'github',
owner: 'foo',
name: 'bar'
}
});
await scaffold({
visibility: 'Private',
vcs: {
host: 'github',
owner: 'foo',
name: 'bar'
},
apiAccessToken: 'XXXXXX'
});
await lift({projectRoot: process.cwd(), packageManager: packageManagers.NPM});
})();
API
scaffold
Scaffolder for configuring reporting of coverage data to Codecov and providing visibility to the current coverage status through a README badge
Takes a single options object as an argument, containing:
object (required) vcs
host
string (required) VCS hosting serviceowner
string (required) account name on the host service for the repositoryname
string (required) repository name
string (required) visibility
Visibility of the project (Public
or Private
).
Unless apiAccessToken
is provided, Codecov
details will only be scaffolded for public projects.
string (optional) apiAccessToken
Personal Access Token for accessing the Codecov API.
Providing an access token enables fetching the image_token
for the repository
so that the coverage badge can display the proper coverage state of the
project when the project is not public.
Since the Codecov API appears to only
support GitHub at the time of this implementation, GitHub is the only VCS host
supported by this scaffolder at this time.
lift
Migrates Codecov details from legacy conventions to modern conventions.
Takes a single options object as an argument, containing:
string (required) projectRoot
path to the root of the project
string (required) packageManager
chosen package manager to be used for the project
Contributing
Dependencies
$ nvm install
$ npm install
Verification
$ npm test