aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/e2e/src/utils/files.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-02-15 16:25:52 +0100
committerChocobozzz <me@florianbigard.com>2023-02-15 16:26:21 +0100
commit1ec4835dcac769d0711bbfeaa63b4e1743fde265 (patch)
treec50faa5a51ebe4827d2762e6b7b4f418da2a9948 /client/e2e/src/utils/files.ts
parent366d5aea5d5b320b54b9cfea9a646d7828de7bae (diff)
downloadPeerTube-1ec4835dcac769d0711bbfeaa63b4e1743fde265.tar.gz
PeerTube-1ec4835dcac769d0711bbfeaa63b4e1743fde265.tar.zst
PeerTube-1ec4835dcac769d0711bbfeaa63b4e1743fde265.zip
Create screenshots directory when needed
Diffstat (limited to 'client/e2e/src/utils/files.ts')
-rw-r--r--client/e2e/src/utils/files.ts17
1 files changed, 17 insertions, 0 deletions
diff --git a/client/e2e/src/utils/files.ts b/client/e2e/src/utils/files.ts
new file mode 100644
index 000000000..c532c987e
--- /dev/null
+++ b/client/e2e/src/utils/files.ts
@@ -0,0 +1,17 @@
1import { mkdirSync } from 'fs'
2import { join } from 'path'
3
4const SCREENSHOTS_DIRECTORY = 'screenshots'
5
6function createScreenshotsDirectory () {
7 mkdirSync(SCREENSHOTS_DIRECTORY, { recursive: true })
8}
9
10function getScreenshotPath (filename: string) {
11 return join(SCREENSHOTS_DIRECTORY, filename)
12}
13
14export {
15 createScreenshotsDirectory,
16 getScreenshotPath
17}