Skip to content

Turn one illustration into an animated 2D mesh avatar with a coding agent and a local editor

Make two tests independent of the platform's file system

shinshin862177443c0d51
diff --git a/e2e/projects-lipsync.spec.ts b/e2e/projects-lipsync.spec.ts
index 77c3944..32b60a0 100644
--- a/e2e/projects-lipsync.spec.ts
+++ b/e2e/projects-lipsync.spec.ts
@@ -12,7 +12,7 @@ test.beforeEach(async () => {
await mkdir(resolve('projects'), { recursive: true });
directory = await mkdtemp(join(resolve('projects'), 'lip-check-')); name = basename(directory);
await cp(resolve('samples/miko-qipao'), directory, { recursive: true,
- filter: path => !path.includes(`${resolve('samples/miko-qipao')}/review`) && !path.includes(`${resolve('samples/miko-qipao')}/built/sprites`) });
+ filter: path => !path.includes(join(resolve('samples/miko-qipao'), 'review')) && !path.includes(join(resolve('samples/miko-qipao'), 'built', 'sprites')) });
});
test.afterEach(async () => { if (directory) await rm(directory, { recursive: true, force: true }); });
async function open(page: Page, project: string) {
diff --git a/e2e/workflow.spec.ts b/e2e/workflow.spec.ts
index 6b3e891..4873a92 100644
--- a/e2e/workflow.spec.ts
+++ b/e2e/workflow.spec.ts
@@ -13,7 +13,7 @@ test.beforeEach(async () => {
await mkdir(resolve('projects'), { recursive: true });
directory = await mkdtemp(join(resolve('projects'), 'workflow-check-')); name = basename(directory);
await cp(resolve('samples/miko-qipao'), directory, { recursive: true,
- filter: path => !['review', 'variants', 'variant-masks', 'built/sprites'].some(folder => path.startsWith(`${resolve('samples/miko-qipao')}/${folder}`)) });
+ filter: path => !['review', 'variants', 'variant-masks', join('built', 'sprites')].some(folder => path.startsWith(join(resolve('samples/miko-qipao'), folder))) });
});
test.afterEach(async () => { if (directory) await rm(directory, { recursive: true, force: true }); });
async function open(page: Page) {
diff --git a/tests/expression-remote.test.ts b/tests/expression-remote.test.ts
index 8135b3a..e066d28 100644
--- a/tests/expression-remote.test.ts
+++ b/tests/expression-remote.test.ts
@@ -33,7 +33,7 @@ test('token is private, persistent and regenerable; requests need it and a valid
expect(first.status).toBe(200); expect(first.head['access-control-allow-origin']).toBeUndefined();
const token = first.json.token as string;
expect(token).toMatch(/^[A-Za-z0-9_-]{32}$/);
- expect((await readFile(file, 'utf8')).trim()).toBe(token); expect((await stat(file)).mode & 0o777).toBe(0o600);
+ expect((await readFile(file, 'utf8')).trim()).toBe(token); expect((await stat(file)).mode & 0o777).toBe(process.platform === 'win32' ? 0o666 : 0o600);
// A fresh server instance reuses the saved token.
const again = expressionRemote(file, () => undefined, () => undefined);
expect((await call(again, 'GET', '/__live/expression-token', { 'x-studio-request': '1' })).json.token).toBe(token);