diff --git a/src/__tests__/unit/lib/co2js/index.test.ts b/src/__tests__/unit/lib/co2js/index.test.ts index 1aee2f8..699f8fd 100644 --- a/src/__tests__/unit/lib/co2js/index.test.ts +++ b/src/__tests__/unit/lib/co2js/index.test.ts @@ -12,17 +12,17 @@ describe('sci:configure test', () => { await expect( model.execute([ { - 'timestamp': '2021-01-01T00:00:00Z', - 'duration': 3600, - 'bytes': 100000, + timestamp: '2021-01-01T00:00:00Z', + duration: 3600, + bytes: 100000, 'green-web-host': true, }, ]) ).resolves.toStrictEqual([ { - 'timestamp': '2021-01-01T00:00:00Z', - 'duration': 3600, - 'bytes': 100000, + timestamp: '2021-01-01T00:00:00Z', + duration: 3600, + bytes: 100000, 'green-web-host': true, 'operational-carbon': 0.023195833333333332, }, diff --git a/src/lib/co2js/index.ts b/src/lib/co2js/index.ts index 876908e..bdb6164 100644 --- a/src/lib/co2js/index.ts +++ b/src/lib/co2js/index.ts @@ -24,14 +24,14 @@ export class Co2jsModel implements ModelPluginInterface { greenhosting = observation['green-web-host']; } let result; - console.log('TYPE', this.staticParams.type) + console.log('TYPE', this.staticParams.type); switch (this.staticParams.type) { case 'swd': { - result = this.model.perVisit(observation['bytes'], greenhosting) + result = this.model.perVisit(observation['bytes'], greenhosting); break; } case '1byte': { - result = this.model.perByte(observation['bytes'], greenhosting) + result = this.model.perByte(observation['bytes'], greenhosting); break; } } @@ -42,9 +42,7 @@ export class Co2jsModel implements ModelPluginInterface { }); } - async configure( - staticParams: object - ): Promise { + async configure(staticParams: object): Promise { if (staticParams !== undefined && 'type' in staticParams) { if (!['1byte', 'swd'].includes(staticParams.type as string)) { throw new Error(