Skip to content

Commit

Permalink
lint: fixes applied from yarn fix
Browse files Browse the repository at this point in the history
Signed-off-by: Gnanakeethan Balasubramaniam <[email protected]>
  • Loading branch information
gnanakeethan committed Dec 5, 2023
1 parent 536d7ae commit 00620f0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
12 changes: 6 additions & 6 deletions src/__tests__/unit/lib/co2js/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down
10 changes: 4 additions & 6 deletions src/lib/co2js/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand All @@ -42,9 +42,7 @@ export class Co2jsModel implements ModelPluginInterface {
});
}

async configure(
staticParams: object
): Promise<ModelPluginInterface> {
async configure(staticParams: object): Promise<ModelPluginInterface> {
if (staticParams !== undefined && 'type' in staticParams) {
if (!['1byte', 'swd'].includes(staticParams.type as string)) {
throw new Error(
Expand Down

0 comments on commit 00620f0

Please sign in to comment.