1
0
mirror of https://github.com/badges/shields.git synced 2025-09-21 03:21:59 +03:00
Files
shields/services/npm/npm-downloads.spec.js
chris48s df8049a765 redirect [npm] /dt to /d18m (#10033)
* redirect [npm] /dt to /d18m

* fix unit test
2024-03-23 19:38:05 +00:00

25 lines
533 B
JavaScript

import { test, given } from 'sazerac'
import NpmDownloads from './npm-downloads.service.js'
describe('NpmDownloads', function () {
test(NpmDownloads._intervalMap.d18m.transform, () => {
given({
downloads: [
{ downloads: 2, day: '2018-01-01' },
{ downloads: 3, day: '2018-01-02' },
],
}).expect(5)
})
test(NpmDownloads.render, () => {
given({
interval: 'd18m',
downloadCount: 0,
}).expect({
color: 'red',
message: '0',
label: undefined,
})
})
})