mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-02-15 18:05:05 +00:00
feat: add CLI command for importing and exporting Pocket ID data (#998)
Co-authored-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
15
tests/specs/fixtures/auth.setup.ts
vendored
Normal file
15
tests/specs/fixtures/auth.setup.ts
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import { test as setup } from '@playwright/test';
|
||||
import { pathFromRoot } from 'utils/fs.util';
|
||||
import authUtil from '../../utils/auth.util';
|
||||
import { cleanupBackend } from '../../utils/cleanup.util';
|
||||
|
||||
const authFile = pathFromRoot('.tmp/auth/user.json');
|
||||
|
||||
setup('authenticate', async ({ page }) => {
|
||||
await cleanupBackend();
|
||||
|
||||
await authUtil.authenticate(page);
|
||||
await page.waitForURL('/settings/account');
|
||||
|
||||
await page.context().storageState({ path: authFile });
|
||||
});
|
||||
8
tests/specs/fixtures/global.setup.ts
vendored
Normal file
8
tests/specs/fixtures/global.setup.ts
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import fs from 'fs';
|
||||
import { tmpDir } from 'utils/fs.util';
|
||||
|
||||
async function globalSetup() {
|
||||
await fs.promises.mkdir(tmpDir, { recursive: true });
|
||||
}
|
||||
|
||||
export default globalSetup;
|
||||
8
tests/specs/fixtures/global.teardown.ts
vendored
Normal file
8
tests/specs/fixtures/global.teardown.ts
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import fs from 'fs';
|
||||
import { tmpDir } from 'utils/fs.util';
|
||||
|
||||
async function globalTeardown() {
|
||||
await fs.promises.rm(tmpDir, { recursive: true, force: true });
|
||||
}
|
||||
|
||||
export default globalTeardown;
|
||||
Reference in New Issue
Block a user