forked from Chocobozzz/PeerTube
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(transcription): use os tm directory where relevant
- Loading branch information
Showing
7 changed files
with
30 additions
and
25 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 4 additions & 3 deletions
7
packages/tests/src/transcription/transcript/transcript-file-evaluator.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 11 additions & 5 deletions
16
packages/tests/src/transcription/transcript/transcript-file.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,32 @@ | ||
/* eslint-disable @typescript-eslint/no-unused-expressions */ | ||
import { expect } from 'chai' | ||
import { mkdir } from 'node:fs/promises' | ||
import { join } from 'node:path' | ||
import { mkdir, rm } from 'node:fs/promises' | ||
import { TranscriptFile } from '@peertube/peertube-transcription' | ||
import { buildAbsoluteFixturePath } from '@peertube/peertube-node-utils' | ||
import { tmpdir } from 'node:os' | ||
|
||
describe('Transcript File', function () { | ||
const transcriptFileDirectory = join(tmpdir(), 'peertube-transcription/transcript-file/') | ||
before(async function () { | ||
await mkdir(buildAbsoluteFixturePath('transcription/transcript/'), { recursive: true }) | ||
await mkdir(transcriptFileDirectory, { recursive: true }) | ||
}) | ||
|
||
it(`may creates a new transcript file from scratch`, async function () { | ||
const transcript1 = await TranscriptFile.write({ | ||
path: buildAbsoluteFixturePath('transcription/transcript/test1.txt'), | ||
path: join(transcriptFileDirectory, 'test1.txt'), | ||
content: 'test2', | ||
format: 'txt' | ||
}) | ||
const transcript2 = await TranscriptFile.write({ | ||
path: buildAbsoluteFixturePath('transcription/transcript/test2.txt'), | ||
path: join(transcriptFileDirectory, 'test2.txt'), | ||
content: 'test2', | ||
format: 'txt' | ||
}) | ||
|
||
expect(await transcript1.equals(transcript2)).to.be.true | ||
}) | ||
|
||
after(async function () { | ||
await rm(transcriptFileDirectory, { recursive: true, force: true }) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters