-
Notifications
You must be signed in to change notification settings - Fork 2
/
TestAvailability.ts
40 lines (38 loc) · 1010 Bytes
/
TestAvailability.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
33
34
35
36
37
38
39
40
import {
TestSuite, Test,
} from 'testyts'
import { ApplicationInsights } from '../src/ApplicationInsights'
import { BaseTestSuite } from './BaseTestSuite'
import { AvailabilityData } from '../src'
@TestSuite()
export class TestAvailability extends BaseTestSuite {
@Test()
async testMinimalAvailability() {
const request = new AvailabilityData({
duration: '00.00:00:15.000000',
})
this.appInsights.trackData(request)
const result = await this.appInsights.flush()
await this.validateResult(result)
}
@Test()
async testFullAvailability() {
const request = new AvailabilityData({
name: 'MyRequest',
id: '9fb98419-6175-46d0-befb-d0f2cff2222f',
duration: '00.00:00:15.000000',
success: true,
message: 'hello',
runLocation: 'location1',
properties: {
data1: 'value1',
},
measurements: {
data2: 2000,
},
})
this.appInsights.trackData(request, 'AvailabilityData')
const result = await this.appInsights.flush()
await this.validateResult(result)
}
}