11/* eslint-disable @typescript-eslint/no-non-null-assertion */
22/* eslint-disable @typescript-eslint/no-non-null-asserted-optional-chain */
33/* eslint-disable no-await-in-loop */
4- import { Backend } from '../../backup/index.js' ;
5- import weaviate , { Collection , WeaviateClient } from '../../index.js' ;
64import { requireAtLeast } from '../../../test/version' ;
5+ import { Backend } from '../../backup/index.js' ;
76import { WeaviateBackupFailed } from '../../errors.js' ;
7+ import weaviate , { Collection , WeaviateClient } from '../../index.js' ;
88
99// These must run sequentially because Weaviate is not capable of running multiple backups at the same time
1010describe ( 'Integration testing of backups' , ( ) => {
@@ -119,11 +119,10 @@ describe('Integration testing of backups', () => {
119119 . then ( testCollectionNoWaitForCompletion ) ) ;
120120
121121 requireAtLeast ( 1 , 32 , 3 ) . describe ( 'overwrite alias' , ( ) => {
122-
123122 test ( 'overwriteAlias=true' , async ( ) => {
124123 const client = await clientPromise ;
125124
126- const things = await client . collections . create ( { name : " ThingsTrue" } ) ;
125+ const things = await client . collections . create ( { name : ' ThingsTrue' } ) ;
127126 await client . alias . create ( { collection : things . name , alias : `${ things . name } Alias` } ) ;
128127
129128 const backup = await client . backup . create ( {
@@ -137,10 +136,9 @@ describe('Integration testing of backups', () => {
137136 await client . alias . delete ( `${ things . name } Alias` ) ;
138137
139138 // Change alias to point to a different collection
140- const inventory = await client . collections . create ( { name : " InventoryTrue" } ) ;
139+ const inventory = await client . collections . create ( { name : ' InventoryTrue' } ) ;
141140 await client . alias . create ( { collection : inventory . name , alias : `${ things . name } Alias` } ) ;
142141
143-
144142 // Restore backup with overwriteAlias=true
145143 await client . backup . restore ( {
146144 backend : 'filesystem' ,
@@ -158,7 +156,7 @@ describe('Integration testing of backups', () => {
158156 test ( 'overwriteAlias=false' , async ( ) => {
159157 const client = await clientPromise ;
160158
161- const things = await client . collections . create ( { name : " ThingsFalse" } ) ;
159+ const things = await client . collections . create ( { name : ' ThingsFalse' } ) ;
162160 await client . alias . create ( { collection : things . name , alias : `${ things . name } Alias` } ) ;
163161
164162 const backup = await client . backup . create ( {
@@ -172,10 +170,9 @@ describe('Integration testing of backups', () => {
172170 await client . alias . delete ( `${ things . name } Alias` ) ;
173171
174172 // Change alias to point to a different collection
175- const inventory = await client . collections . create ( { name : " InventoryFalse" } ) ;
173+ const inventory = await client . collections . create ( { name : ' InventoryFalse' } ) ;
176174 await client . alias . create ( { collection : inventory . name , alias : `${ things . name } Alias` } ) ;
177175
178-
179176 // Restore backup with overwriteAlias=true
180177 const restored = client . backup . restore ( {
181178 backend : 'filesystem' ,
@@ -190,13 +187,16 @@ describe('Integration testing of backups', () => {
190187 } ) ;
191188
192189 it ( 'cleanup' , async ( ) => {
193- await clientPromise . then ( async c => {
194- await Promise . all ( [ "ThingsTrue" , "ThingsFalse" , "InventoryTrue" , "InventoryFalse" ]
195- . map ( name => c . collections . delete ( name ) . catch ( e => { } ) ) ) ;
196- await c . alias . delete ( "ThingsFalseAlias" ) . catch ( e => { } ) ;
197- await c . alias . delete ( "ThingsTrueAlias" ) . catch ( e => { } ) ;
190+ await clientPromise . then ( async ( c ) => {
191+ await Promise . all (
192+ [ 'ThingsTrue' , 'ThingsFalse' , 'InventoryTrue' , 'InventoryFalse' ] . map ( ( name ) =>
193+ c . collections . delete ( name ) . catch ( ( e ) => { } )
194+ )
195+ ) ;
196+ await c . alias . delete ( 'ThingsFalseAlias' ) . catch ( ( e ) => { } ) ;
197+ await c . alias . delete ( 'ThingsTrueAlias' ) . catch ( ( e ) => { } ) ;
198198 } ) ;
199- } )
199+ } ) ;
200200 } ) ;
201201} ) ;
202202
0 commit comments