-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #120 Signed-off-by: Gnanakeethan Balasubramaniam <[email protected]>
- Loading branch information
1 parent
461e0e4
commit da196bc
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import {describe, expect, jest, test} from '@jest/globals'; | ||
import {SciOModel} from './index'; | ||
jest.setTimeout(30000); | ||
|
||
describe('ccf:configure test', () => { | ||
test('initialize and test', async () => { | ||
const model = await new SciOModel().configure('ccf', {}); | ||
expect(model).toBeInstanceOf(SciOModel); | ||
await expect( | ||
model.calculate([ | ||
{ | ||
'grid-ci': 200.0, | ||
energy: 100.0, | ||
}, | ||
]) | ||
).resolves.toStrictEqual([ | ||
{ | ||
'grid-ci': 200.0, | ||
energy: 100.0, | ||
'operational-emissions': 100.0 * 200.0, | ||
}, | ||
]); | ||
await expect( | ||
model.calculate([ | ||
{ | ||
'grid-ci': 212.1, | ||
energy: 100.0, | ||
}, | ||
]) | ||
).resolves.toStrictEqual([ | ||
{ | ||
'grid-ci': 212.1, | ||
energy: 100.0, | ||
'operational-emissions': 100.0 * 212.1, | ||
}, | ||
]); | ||
}); | ||
}); |