-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfetch_prices_1.ts
32 lines (26 loc) · 916 Bytes
/
fetch_prices_1.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import moment from 'moment-timezone';
import Logger from '@balmli/homey-logger';
import {Currency, NordpoolApi} from "../lib";
moment.tz.setDefault("Europe/Oslo");
describe('Fetch prices', function () {
describe('Check fetch prices', function () {
it('Check fetch prices 1', function (done) {
const api = new NordpoolApi({
logger: new Logger({
logLevel: 3,
prefix: undefined,
})
});
const localTime = moment().startOf('day');
api.fetchPrices(localTime, {priceArea: 'Bergen', currency: Currency.NOK})
.then((prices) => {
//console.log(prices);
done();
})
.catch((err) => {
console.log('ERROR', err)
done();
});
});
});
});