-
Notifications
You must be signed in to change notification settings - Fork 2
/
TestMessage.ts
36 lines (34 loc) · 884 Bytes
/
TestMessage.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
import {
TestSuite, Test,
} from 'testyts'
import { ApplicationInsights } from '../src/ApplicationInsights'
import { BaseTestSuite } from './BaseTestSuite'
import { MessageData, SeverityLevel } from '../src'
@TestSuite()
export class TestMessage extends BaseTestSuite {
@Test()
async testMinimalMessage() {
const request = new MessageData({
message: 'Test message',
})
this.appInsights.trackData(request)
const result = await this.appInsights.flush()
await this.validateResult(result)
}
@Test()
async testFullMessage() {
const request = new MessageData({
message: 'Test message',
severityLevel: SeverityLevel.Information,
properties: {
data1: 'value1',
},
measurements: {
data2: 2000,
},
})
this.appInsights.trackData(request, 'MessageData')
const result = await this.appInsights.flush()
await this.validateResult(result)
}
}