merge: integrate upstream main with local Makelore changes
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
// @vitest-environment node
|
||||
|
||||
import { copyFile, mkdir, mkdtemp, rename, rm, stat } from 'node:fs/promises';
|
||||
import { copyFile, mkdir, mkdtemp, realpath, rename, rm, stat } from 'node:fs/promises';
|
||||
import { tmpdir } from 'node:os';
|
||||
import path from 'node:path';
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest';
|
||||
@@ -211,10 +211,10 @@ describe('coding project durable identity', () => {
|
||||
expect(movedConfig).toMatchObject({ status: 'valid', config: { projectId: PROJECT_ID } });
|
||||
|
||||
const copiedPath = path.join(parent, 'copied');
|
||||
await mkdir(path.join(copiedPath, '.niancode'), { recursive: true });
|
||||
await mkdir(path.join(copiedPath, '.makelore'), { recursive: true });
|
||||
await copyFile(
|
||||
path.join(movedPath, '.niancode', 'project.json'),
|
||||
path.join(copiedPath, '.niancode', 'project.json'),
|
||||
path.join(movedPath, '.makelore', 'project.json'),
|
||||
path.join(copiedPath, '.makelore', 'project.json'),
|
||||
);
|
||||
const copied = await readCodingProjectConfigV2(copiedPath);
|
||||
expect(copied).toMatchObject({ status: 'valid', config: { projectId: PROJECT_ID } });
|
||||
@@ -229,7 +229,9 @@ describe('coding project durable identity', () => {
|
||||
|
||||
const active = await projects.requireActiveRealProjectWithIdentity(projectPath);
|
||||
expect(active).toMatchObject({ project: local.project, projectId: PROJECT_ID });
|
||||
expect(normalizeCodingProjectPath(active.path)).toBe(normalizeCodingProjectPath(local.project.path));
|
||||
expect(normalizeCodingProjectPath(active.path)).toBe(
|
||||
normalizeCodingProjectPath(await realpath(local.project.path)),
|
||||
);
|
||||
const otherPath = await makeRoot('makelore-project-identity-other-');
|
||||
await expect(projects.requireActiveRealProjectWithIdentity(otherPath)).rejects.toMatchObject({
|
||||
code: 'CODING_ACTIVE_PROJECT_PATH_MISMATCH',
|
||||
|
||||
Reference in New Issue
Block a user