|
7 | 7 | import { PropagatorType } from '../../rum/types'; |
8 | 8 | import { |
9 | 9 | FileBasedConfiguration, |
10 | | - formatPropagatorType, |
11 | | - getJSONConfiguration |
| 10 | + formatPropagatorType |
12 | 11 | } from '../FileBasedConfiguration'; |
13 | 12 |
|
14 | 13 | import configurationAllFields from './__fixtures__/configuration-all-fields.json'; |
@@ -93,10 +92,17 @@ describe('FileBasedConfiguration', () => { |
93 | 92 |
|
94 | 93 | it('prints a warning message when the configuration file cannot be parsed correctly', () => { |
95 | 94 | const warnSpy = jest.spyOn(console, 'warn'); |
96 | | - getJSONConfiguration(malformedConfiguration); |
| 95 | + const config = new FileBasedConfiguration({ |
| 96 | + configuration: malformedConfiguration |
| 97 | + }); |
97 | 98 |
|
| 99 | + expect(config).not.toBeUndefined(); |
| 100 | + expect(warnSpy).toHaveBeenCalledTimes(2); |
| 101 | + expect(warnSpy).toHaveBeenCalledWith( |
| 102 | + 'DATADOG: Warning - Malformed json configuration file - `clientToken`, `env` and `trackingConsent` are mandatory Core SDK properties.' |
| 103 | + ); |
98 | 104 | expect(warnSpy).toHaveBeenCalledWith( |
99 | | - 'DATADOG: Warning: Malformed json configuration file - clientToken and env are mandatory Core SDK properties. ApplicationId is mandatory to enable RUM.' |
| 105 | + 'DATADOG: Warning - Malformed RUM File Configuration - `applicationId` is undefined.' |
100 | 106 | ); |
101 | 107 | }); |
102 | 108 |
|
@@ -141,6 +147,7 @@ describe('FileBasedConfiguration', () => { |
141 | 147 | "clientToken": "fake-client-token", |
142 | 148 | "env": "fake-env", |
143 | 149 | "initializationMode": "SYNC", |
| 150 | + "logsConfiguration": undefined, |
144 | 151 | "proxyConfiguration": undefined, |
145 | 152 | "rumConfiguration": RumConfiguration { |
146 | 153 | "actionEventMapper": null, |
@@ -214,6 +221,7 @@ describe('FileBasedConfiguration', () => { |
214 | 221 | "clientToken": "fake-client-token", |
215 | 222 | "env": "fake-env", |
216 | 223 | "initializationMode": "SYNC", |
| 224 | + "logsConfiguration": undefined, |
217 | 225 | "proxyConfiguration": undefined, |
218 | 226 | "rumConfiguration": RumConfiguration { |
219 | 227 | "actionEventMapper": null, |
@@ -246,6 +254,7 @@ describe('FileBasedConfiguration', () => { |
246 | 254 | }, |
247 | 255 | "service": undefined, |
248 | 256 | "site": "US1", |
| 257 | + "traceConfiguration": undefined, |
249 | 258 | "trackingConsent": "granted", |
250 | 259 | "uploadFrequency": "AVERAGE", |
251 | 260 | "verbosity": undefined, |
|
0 commit comments