Skip to content

Commit 67bef0a

Browse files
committed
fix: restore bruno.json
1 parent c758781 commit 67bef0a

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/protobuf/manage-protofile.spec.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,28 @@
1+
import path from 'path';
12
import { test, expect } from '../../playwright';
23
import { 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

49
test.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 }) => {

0 commit comments

Comments
 (0)