new Coverage()
- Source:
Properties:
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
run_at |
string | the iso date when the coverage was send to the server |
|||||||||||||||||||||||||||||||||||||||
source_files |
Array.<Object> | a list of all the source files related to the coverage report |
|||||||||||||||||||||||||||||||||||||||
source_files[].name |
string | the name of the file parsed |
|||||||||||||||||||||||||||||||||||||||
source_files[].source |
string | the content of the file parsed into a string |
|||||||||||||||||||||||||||||||||||||||
source_files[].coverage |
Array.<Object> | an array of objects describing the state of the parsed file |
|||||||||||||||||||||||||||||||||||||||
source_files[].coverage[].lines |
object | an object descibing the lines covered in the file Properties
|
|||||||||||||||||||||||||||||||||||||||
source_files[].coverage[].functions |
object | an object descibing the functions covered in the file Properties
|
|||||||||||||||||||||||||||||||||||||||
source_files[].coverage[].branches |
object | an object descibing the branches covered in the file Properties
|
|||||||||||||||||||||||||||||||||||||||
git |
object | the state of the git config at the time of sending coverage Properties
|
Example
{
"source_files": [{
"name": "util/lcov.js",
"source": "function d() {\n return \'hello\';\n}",
"coverage": [{
"lines": {
"found": 53,
"hit": 53,
"details": [{
"line": 1,
"hit": 1
}, {...}]
},
"functions": {
"hit": 6,
"found": 6,
"details": [{
"name": "(anonymous_0)",
"line": 7,
"hit": 3
}, {...}]
},
"branches": {
"hit": 24,
"found": 24,
"details": [{
"line": 16,
"block": 0,
"branch": 0,
"taken": 4
}, {...}]
},
"title": "",
"source": "",
"file": "/Users/gacsapo/Documents/temp/node-coverage-server/util/lcov.js"
}]
}],
"git": {
"head": {
"id": "07e4ee9f38d7c41fed09a2b93f6ce23c4a2c49da",
"committer_name": "Gabriel Csapo",
"committer_email": "gabecsapo@gmail.com",
"message": "Initial commit",
"author_name": "Gabriel Csapo",
"author_email": "gabecsapo@gmail.com"
},
"branch": "master",
"remotes": [{
"name": "origin",
"url": "https://github.com/gabrielcsapo/node-coverage-server.git"
}]
},
"run_at": "2017-01-17T23:18:16.248Z"
}
Methods
(static) get(repo, limitopt) → {Array.<Coverage>}
- Source:
gets a repos coverage model or all coverage models
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
repo |
string | the url of the repo |
|
limit |
number |
<optional> |
limit the history of the coverage reports for a specific repo, default is infinite |
Returns:
- a promise that resolves with the model after it was inserted
- Type
- Array.<Coverage>
(static) repos(repo) → {Promise}
- Source:
gets a list of repos
Parameters:
Name | Type | Description |
---|---|---|
repo |
string | the url of the repo |
Returns:
- a promise that resolves with the model after it was inserted
- Type
- Promise
(static) save(model) → {Promise}
- Source:
saves a coverage model the collection
Parameters:
Name | Type | Description |
---|---|---|
model |
Coverage | the coverage model |
Returns:
- a promise that resolves with the model after it was inserted
- Type
- Promise