push
github
6288 of 6565 branches covered (95.78%)
39 of 40 new or added lines in 1 file covered. (97.5%)
22 existing lines in 7 files now uncovered.47090 of 50681 relevant lines covered (92.91%)
120.05 hits per line
1 |
import { pathParams } from '../index.js' |
|
2 |
import { metric } from '../text-formatters.js' |
1✔ |
3 |
import { BaseHangarService, description } from './hangar-base.js' |
1✔ |
4 |
|
1✔ |
5 |
export default class HangarViews extends BaseHangarService { |
|
6 |
static category = 'other' |
3✔ |
7 |
|
3✔ |
8 |
static route = {
|
3✔ |
9 |
base: 'hangar/views', |
3✔ |
10 |
pattern: ':slug', |
3✔ |
11 |
} |
3✔ |
12 |
|
3✔ |
13 |
static openApi = {
|
3✔ |
14 |
'/hangar/views/{slug}': {
|
3✔ |
15 |
get: {
|
3✔ |
16 |
summary: 'Hangar Views', |
3✔ |
17 |
description, |
3✔ |
18 |
parameters: pathParams({
|
3✔ |
19 |
name: 'slug', |
3✔ |
20 |
example: 'Essentials', |
3✔ |
21 |
}), |
3✔ |
22 |
}, |
3✔ |
23 |
}, |
× |
24 |
} |
× |
25 |
|
× |
26 |
static defaultBadgeData = {
|
× |
27 |
label: 'views', |
3✔ |
28 |
color: 'blue', |
3✔ |
29 |
} |
× |
30 |
|
× |
31 |
static render({ views }) {
|
3✔ |
UNCOV
32
|
return {
|
× |
UNCOV
33
|
message: metric(views),
|
× |
UNCOV
34
|
} |
× |
UNCOV
35
|
} |
× |
36 |
|
3✔ |
37 |
async handle({ slug }) { |
|
38 |
const { |
8✔ |
39 |
stats: { views },
|
8✔ |
40 |
} = await this.fetch({ slug })
|
8✔ |
UNCOV
41
|
return this.constructor.render({ views }) |
|
42 |
} |
8✔ |
43 |
} |
3✔ |