Skip to content

The open source AI video agent: turns any coding agent into a video agent, with an editor to change anything it makes.

Tests: what needs a link to a file is skipped without Developer Mode on Windows; folder links are junctions there (#248)

WEBGRS75b561243c59
diff --git a/.changeset/links-without-developer-mode.md b/.changeset/links-without-developer-mode.md
new file mode 100644
index 0000000..a845151
--- /dev/null
+++ b/.changeset/links-without-developer-mode.md
@@ -0,0 +1,2 @@
+---
+---
diff --git a/packages/openfilm/src/shared.test.mjs b/packages/openfilm/src/shared.test.mjs
index abdc66e..b4919fa 100644
--- a/packages/openfilm/src/shared.test.mjs
+++ b/packages/openfilm/src/shared.test.mjs
@@ -111,13 +111,16 @@ test('fileOf: a sound stays inside the film\'s folder, however its path is writt
/* a slash hidden as %2F is decoded after the URL resolved its `..`: the join must not walk out */
assert.throws(() => fileOf(ws, 'film.html', 'x%2F..%2F..%2Foutside.mp3'), /outside the film's folder/);
assert.throws(() => fileOf(ws, 'film.html', '%2E%2E%2Foutside.mp3'), /outside the film's folder/);
- /* a link inside the folder that leads out of it */
- symlinkSync(join(root, 'outside.mp3'), join(ws, 'assets', 'link.mp3'));
- assert.throws(() => fileOf(ws, 'film.html', 'assets/link.mp3'), /link out of the film's folder/);
+ /* a link inside the folder that leads out of it (links need Developer Mode on Windows: there the rest of the
+ test stands) */
+ if (process.platform !== 'win32') {
+ symlinkSync(join(root, 'outside.mp3'), join(ws, 'assets', 'link.mp3'));
+ assert.throws(() => fileOf(ws, 'film.html', 'assets/link.mp3'), /link out of the film's folder/);
+ }
} finally { rmSync(root, { recursive: true, force: true }); }
});
-test('fileOf: a link to media the person linked is followed; a link a project brought from elsewhere is not', () => {
+test('fileOf: a link to media the person linked is followed; a link a project brought from elsewhere is not', { skip: process.platform === 'win32' && 'links need Developer Mode on Windows' }, () => {
/* the places the person linked are kept in Studio's home: this test's own */
const home = process.env.OPENFILM_HOME;
const root = mkdtempSync(join(tmpdir(), 'openfilm-fileof-links-'));
diff --git a/packages/openfilm/studio/server/browse.test.mjs b/packages/openfilm/studio/server/browse.test.mjs
index aa4e9c4..716db3d 100644
--- a/packages/openfilm/studio/server/browse.test.mjs
+++ b/packages/openfilm/studio/server/browse.test.mjs
@@ -18,8 +18,9 @@ before(() => {
writeFileSync(join(root, 'Films', 'Launch', 'film.html'), '<!doctype html>');
writeFileSync(join(root, 'a file.txt'), 'x');
writeFileSync(join(outside, 'film.html'), '<!doctype html>');
- symlinkSync(outside, join(root, 'out-link'), 'dir');
- symlinkSync(join(root, 'Films'), join(root, 'films-link'), 'dir');
+ /* a junction on Windows, which needs no Developer Mode; a symlink elsewhere */
+ symlinkSync(outside, join(root, 'out-link'), 'junction');
+ symlinkSync(join(root, 'Films'), join(root, 'films-link'), 'junction');
});
const refused = async (path, code) => assert.rejects(browseFolder(path, { root }), (e) => e instanceof BrowseError && e.code === code, path);
diff --git a/packages/openfilm/studio/server/exports.test.mjs b/packages/openfilm/studio/server/exports.test.mjs
index 230ac30..b4cc730 100644
--- a/packages/openfilm/studio/server/exports.test.mjs
+++ b/packages/openfilm/studio/server/exports.test.mjs
@@ -1255,10 +1255,14 @@ function fullProject() {
put('.git/HEAD');
put('node_modules/x/index.js');
put('.DS_Store');
- /* footage linked in from elsewhere: the export carries the file itself */
+ /* footage linked in from elsewhere: the export carries the file itself (links need Developer Mode on Windows:
+ without it the footage is a copy) */
const outside = join(dir, '..', 'shoot.mov');
writeFileSync(outside, 'footage');
- symlinkSync(outside, join(dir, 'assets', 'shoot.mov'));
+ try { symlinkSync(outside, join(dir, 'assets', 'shoot.mov')); } catch (e) {
+ if (e.code !== 'EPERM') throw e;
+ writeFileSync(join(dir, 'assets', 'shoot.mov'), 'footage');
+ }
return dir;
}