|
1 | 1 | // Copyright (c) Microsoft Corporation. |
2 | 2 | // Licensed under the MIT license. |
3 | 3 |
|
4 | | -const chai = require("chai"); |
5 | | -const chaiAsPromised = require("chai-as-promised"); |
| 4 | +import * as chai from "chai"; |
| 5 | +import * as chaiAsPromised from "chai-as-promised"; |
6 | 6 | chai.use(chaiAsPromised); |
7 | 7 | const expect = chai.expect; |
8 | | -const { load } = require("../dist/index"); |
9 | | -const { |
10 | | - mockAppConfigurationClientListConfigurationSettings, |
11 | | - mockAppConfigurationClientGetConfigurationSetting, |
12 | | - restoreMocks, |
13 | | - createMockedConnectionString, |
14 | | - createMockedKeyValue, |
15 | | -} = require("./utils/testHelper"); |
16 | | -const { promisify } = require("util") |
| 8 | +import { load } from "./exportedApi"; |
| 9 | +import { mockAppConfigurationClientListConfigurationSettings, mockAppConfigurationClientGetConfigurationSetting, restoreMocks, createMockedConnectionString, createMockedKeyValue } from "./utils/testHelper"; |
| 10 | +import { promisify } from "util"; |
17 | 11 | const sleepInMs = promisify(setTimeout); |
18 | | -const uuid = require("uuid"); |
| 12 | +import * as uuid from "uuid"; |
19 | 13 |
|
20 | | -let mockedKVs = []; |
| 14 | +let mockedKVs: any[] = []; |
21 | 15 |
|
22 | | -function updateSetting(key, value) { |
| 16 | +function updateSetting(key: string, value: any) { |
23 | 17 | const setting = mockedKVs.find(elem => elem.key === key); |
24 | 18 | if (setting) { |
25 | 19 | setting.value = value; |
26 | 20 | setting.etag = uuid.v4(); |
27 | 21 | } |
28 | 22 | } |
29 | | -function addSetting(key, value) { |
| 23 | +function addSetting(key: string, value: any) { |
30 | 24 | mockedKVs.push(createMockedKeyValue({ key, value })); |
31 | 25 | } |
32 | 26 |
|
|
0 commit comments