diff --git a/src/lib/boavizta/index.test.ts b/src/lib/boavizta/index.test.ts index 798429942..db4244045 100644 --- a/src/lib/boavizta/index.test.ts +++ b/src/lib/boavizta/index.test.ts @@ -1,5 +1,5 @@ -import { describe, expect, jest, test } from '@jest/globals'; -import { BoaviztaCloudImpactModel, BoaviztaCpuImpactModel } from './index'; +import {describe, expect, jest, test} from '@jest/globals'; +import {BoaviztaCloudImpactModel, BoaviztaCpuImpactModel} from './index'; import axios from 'axios'; import * as PROVIDERS from '../../__mocks__/boavizta/providers.json'; import * as COUNTRIES from '../../__mocks__/boavizta/countries.json'; @@ -13,9 +13,9 @@ const mockAxios = axios as jest.Mocked; mockAxios.get.mockImplementation(url => { switch (url) { case 'https://api.boavizta.org/v1/cloud/all_providers': - return Promise.resolve({ data: PROVIDERS }); + return Promise.resolve({data: PROVIDERS}); case 'https://api.boavizta.org/v1/utils/country_code': - return Promise.resolve({ data: COUNTRIES }); + return Promise.resolve({data: COUNTRIES}); case 'https://api.boavizta.org/v1/cloud/all_instances?provider=aws': return Promise.resolve({ data: INSTANCE_TYPES['aws'], @@ -29,15 +29,15 @@ mockAxios.post.mockImplementation(url => { case 'https://api.boavizta.org/v1/component/cpu?verbose=false&allocation=LINEAR': return Promise.resolve({ data: { - gwp: { manufacture: 0.1, use: 1.0, unit: 'kgCO2eq' }, - pe: { manufacture: 0.1, use: 1.0, unit: 'MJ' }, + gwp: {manufacture: 0.1, use: 1.0, unit: 'kgCO2eq'}, + pe: {manufacture: 0.1, use: 1.0, unit: 'MJ'}, }, }); case 'https://api.boavizta.org/v1/cloud/?verbose=false&allocation=LINEAR': return Promise.resolve({ data: { - gwp: { manufacture: 0.1, use: 1.0, unit: 'kgCO2eq' }, - pe: { manufacture: 0.1, use: 1.0, unit: 'MJ' }, + gwp: {manufacture: 0.1, use: 1.0, unit: 'kgCO2eq'}, + pe: {manufacture: 0.1, use: 1.0, unit: 'MJ'}, }, }); } @@ -48,7 +48,7 @@ describe('cpu:configure test', () => { const impactModel = new BoaviztaCpuImpactModel(); await expect( - impactModel.configure('test', { allocation: 'wrong' }) + impactModel.configure('test', {allocation: 'wrong'}) ).rejects.toThrowError(); expect(impactModel.name).toBe('test'); }); @@ -68,7 +68,7 @@ describe('cpu:configure test', () => { ); // improper observations will throw a invalid observations error await expect( - impactModel.calculate([{ invalid: 'observation' }]) + impactModel.calculate([{invalid: 'observation'}]) ).rejects.toStrictEqual( Error('Invalid Input: Invalid observations parameter') );