Last eslint tweak (#18198)

* Should be there now

* Format
This commit is contained in:
Rijk van Zanten
2023-04-14 17:40:50 -04:00
committed by GitHub
parent 37658802b7
commit c48309ab68
293 changed files with 1627 additions and 1 deletions

View File

@@ -10,6 +10,7 @@ vi.mock('../env');
let mockStorage: StorageManager;
let mockDriver: typeof Driver;
let sample: {
name: string;
};

View File

@@ -18,6 +18,7 @@ let sample: {
};
locations: string[];
};
let mockStorage: StorageManager;
beforeEach(() => {
@@ -42,9 +43,11 @@ beforeEach(() => {
} as unknown as StorageManager;
vi.mocked(getConfigFromEnv).mockImplementation((name) => sample.options[name]!);
vi.mocked(getEnv).mockReturnValue({
STORAGE_LOCATIONS: sample.locations.join(', '),
});
vi.mocked(toArray).mockReturnValue(sample.locations);
});
@@ -61,6 +64,7 @@ test('Gets config for each location', async () => {
await registerLocations(mockStorage);
expect(getConfigFromEnv).toHaveBeenCalledTimes(sample.locations.length);
sample.locations.forEach((location) =>
expect(getConfigFromEnv).toHaveBeenCalledWith(`STORAGE_${location.toUpperCase()}_`)
);
@@ -70,6 +74,7 @@ test('Registers location with driver options for each location', async () => {
await registerLocations(mockStorage);
expect(mockStorage.registerLocation).toHaveBeenCalledTimes(sample.locations.length);
sample.locations.forEach((location) => {
const { driver, ...options } = sample.options[`STORAGE_${location.toUpperCase()}_`]!;