Skip to content

🎥 Make videos programmatically with React

fix test and take the consequences

Jonny Burger9191cafaac23
diff --git a/packages/create-video/src/init.ts b/packages/create-video/src/init.ts
index 2d0ca55db4..870dc0d06d 100644
--- a/packages/create-video/src/init.ts
+++ b/packages/create-video/src/init.ts
@@ -1,5 +1,6 @@
import chalk from 'chalk';
import execa from 'execa';
+import path from 'node:path';
import {createYarnYmlFile} from './add-yarn2-support';
import {degit} from './degit';
import {getLatestRemotionVersion} from './latest-remotion-version';
@@ -85,7 +86,9 @@ export const init = async () => {
if (result.type === 'is-git-repo') {
const should = await yesOrNo({
defaultValue: false,
- question: `You are already inside a Git repo (${result.location}).\nThis might lead to a Git Submodule being created. Do you want to continue? (y/N):`,
+ question: `You are already inside a Git repo (${path.resolve(
+ result.location
+ )}).\nThis might lead to a Git Submodule being created. Do you want to continue? (y/N):`,
});
if (!should) {
Log.error('Aborting.');
diff --git a/packages/create-video/src/test/git-status.test.ts b/packages/create-video/src/test/git-status.test.ts
index 520edf5f50..fc54a80ad7 100644
--- a/packages/create-video/src/test/git-status.test.ts
+++ b/packages/create-video/src/test/git-status.test.ts
@@ -6,12 +6,15 @@ test('Get git status', async () => {
const status = await checkGitAvailability(process.cwd(), 'git', [
'--version',
]);
- expect(status).toEqual({
- type: 'is-git-repo',
- location: path.posix
- .join(__dirname, '..', '..', '..', '..')
- .replace(/\\/g, '/'),
- });
+ if (status.type !== 'is-git-repo') {
+ throw new Error('is git repo');
+ }
+
+ expect(
+ status.location ===
+ path.posix.join(__dirname, '..', '..', '..', '..').replace(/\\/g, '/') ||
+ status.location === '../../..'
+ ).toEqual(true);
if (status.type !== 'is-git-repo') {
throw new Error('is git repo');