@cloud-carbon-footprint/core
Version:
The core logic to get cloud usage data and estimate energy and carbon emissions.
30 lines (24 loc) • 641 B
text/typescript
/*
* © 2021 Thoughtworks, Inc.
*/
import { calculateGigabyteHours, getPhysicalChips } from '../helpers'
describe('helpers', () => {
it('getPhysicalChips', () => {
// when
const result = getPhysicalChips(300)
// then
expect(result).toEqual(4)
})
it('calculateGigabyteHours gigabyteHours is cero', () => {
// when
const result = calculateGigabyteHours(1, 1, 2, 0, 0)
// then
expect(result).toBe(0)
})
it('calculateGigabyteHours gigabyteHours is not undefined', () => {
// when
const result = calculateGigabyteHours(1, 10, 5, 20, 20)
// then
expect(result).toEqual(200)
})
})