File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 1+ import path from 'path' ;
12import { test , expect } from '../../playwright' ;
23import { closeAllCollections } from '../utils/page' ;
4+ import fs from 'fs' ;
5+
6+ const COLLECTION_PATH = path . join ( __dirname , 'collection' , 'bruno.json' ) ;
7+ const BACKUP_PATH = path . join ( __dirname , 'collection' , 'bruno.json.backup' ) ;
38
49test . describe ( 'manage protofile' , ( ) => {
10+ test . beforeAll ( async ( ) => {
11+ // Backup original file
12+ if ( fs . existsSync ( COLLECTION_PATH ) ) {
13+ fs . copyFileSync ( COLLECTION_PATH , BACKUP_PATH ) ;
14+ }
15+ } ) ;
16+
517 test . afterAll ( async ( { pageWithUserData : page } ) => {
18+ // Close all collections
619 await closeAllCollections ( page ) ;
20+
21+ // Restore original file
22+ if ( fs . existsSync ( BACKUP_PATH ) ) {
23+ fs . copyFileSync ( BACKUP_PATH , COLLECTION_PATH ) ;
24+ fs . unlinkSync ( BACKUP_PATH ) ;
25+ }
726 } ) ;
827
928 test ( 'protofiles, import paths from bruno.json are visible in the protobuf settings' , async ( { pageWithUserData : page } ) => {
You can’t perform that action at this time.
0 commit comments