test(08-01): migrate data-layer tests into __test__ dirs

Move 65 *.test.ts + 6 *.perf.ts across data-{common,base,system,state} into sibling __test__/ (data-state/test -> data-state/__test__), incl. fixtures/floors.json and non-test helpers; rewrite Rule A relative specifiers (+1 depth), keep Rule B unchanged; sync script/test-data-node.ts require paths. Gates: test:ci=66 files, test:perf=6 files, eslint clean, zero config/production changes.
This commit is contained in:
AncTe committed 2026-10-04 17:34:09 +08:00
1 parent 109fad3b29
commit 36d8b4fb3c
75 files changed
+201 -201

No files matched your search

@@ -13,9 +13,9 @@ import {
TileType
} from '@user/data-common';
import { DirectionMapper, logger } from '@motajs/common';
import { type IResizableMapLayer } from './types';
import { MapState } from './mapState';
import { DynamicTile } from './dynamicTile';
import { type IResizableMapLayer } from '../types';
import { MapState } from '../mapState';
import { DynamicTile } from '../dynamicTile';
vi.hoisted(() => {
vi.stubGlobal('main', { replayChecking: true });
@@ -7,7 +7,7 @@ import {
} from '@user/data-common';
interface TestModules {
MapState: typeof import('./mapState').MapState;
MapState: typeof import('../mapState').MapState;
TileStore: typeof import('@user/data-common').TileStore;
RoleFaceBinder: typeof import('@user/data-common').RoleFaceBinder;
DirectionMapper: typeof import('@motajs/common').DirectionMapper;
@@ -29,7 +29,7 @@ beforeAll(async () => {
this.set(key, value);
return value;
};
const mapModule = await import('./mapState');
const mapModule = await import('../mapState');
const commonModule = await import('@user/data-common');
const loggerModule = await import('@motajs/common');
modules = {
@@ -1,7 +1,7 @@
// 测试 LayerEventView 的参考基准、dirty 状态和恢复行为
import { afterAll, describe, expect, it, vi } from 'vitest';
import { logger } from '@motajs/common';
import { LayerEventView } from './eventView';
import { LayerEventView } from '../eventView';
vi.hoisted(() => {
vi.stubGlobal('main', { replayChecking: true });
@@ -11,8 +11,8 @@ import {
TileType
} from '@user/data-common';
import { DirectionMapper, logger } from '@motajs/common';
import { type IMapLayer } from './types';
import { GameMap } from './gameMap';
import { type IMapLayer } from '../types';
import { GameMap } from '../gameMap';
vi.hoisted(() => {
vi.stubGlobal('main', { replayChecking: true });
@@ -18,9 +18,9 @@ import {
type IDynamicTile,
type IGameMap,
type IResizableMapLayer
} from './types';
import { DynamicTile } from './dynamicTile';
import { MapState } from './mapState';
} from '../types';
import { DynamicTile } from '../dynamicTile';
import { MapState } from '../mapState';
vi.hoisted(() => {
vi.stubGlobal('main', { replayChecking: true });
@@ -1,6 +1,6 @@
// 测试图块默认事件、点事件存读档、压缩聚合和尺寸变化
import { beforeAll, describe, expect, it, vi } from 'vitest';
import { type IResizableMapLayer } from './types';
import { type IResizableMapLayer } from '../types';
import {
type IDataCommon,
type ITileStore,
@@ -24,7 +24,7 @@ vi.hoisted(() => {
});
interface TestModules {
MapState: typeof import('./mapState').MapState;
MapState: typeof import('../mapState').MapState;
TileStore: typeof import('@user/data-common').TileStore;
RoleFaceBinder: typeof import('@user/data-common').RoleFaceBinder;
FaceManager: typeof import('@user/data-common').FaceManager;
@@ -37,7 +37,7 @@ let modules: TestModules;
beforeAll(async () => {
vi.stubGlobal('main', { replayChecking: true });
vi.stubGlobal('location', { origin: 'http://localhost' });
const mapModule = await import('./mapState');
const mapModule = await import('../mapState');
const commonModule = await import('@user/data-common');
const motaModule = await import('@motajs/common');
modules = {
@@ -12,7 +12,7 @@ import {
TileType
} from '@user/data-common';
import { DirectionMapper, logger } from '@motajs/common';
import { MapState } from './mapState';
import { MapState } from '../mapState';
vi.hoisted(() => {
vi.stubGlobal('main', { replayChecking: true });
@@ -12,10 +12,10 @@ import {
TileType
} from '@user/data-common';
import { DirectionMapper, logger } from '@motajs/common';
import { type IResizableMapLayer } from './types';
import { MapState } from './mapState';
import { DynamicTile } from './dynamicTile';
import { DynamicTileMover } from './mover';
import { type IResizableMapLayer } from '../types';
import { MapState } from '../mapState';
import { DynamicTile } from '../dynamicTile';
import { DynamicTileMover } from '../mover';
vi.hoisted(() => {
vi.stubGlobal('main', { replayChecking: true });
@@ -11,8 +11,8 @@ import {
TileType
} from '@user/data-common';
import { DirectionMapper, logger } from '@motajs/common';
import { type IGameMap, type IResizableMapLayer } from './types';
import { MapState } from './mapState';
import { type IGameMap, type IResizableMapLayer } from '../types';
import { MapState } from '../mapState';
vi.hoisted(() => {
vi.stubGlobal('main', { replayChecking: true });
@@ -11,9 +11,9 @@ import {
TileType
} from '@user/data-common';
import { DirectionMapper } from '@motajs/common';
import { type IResizableMapLayer } from './types';
import { MapState } from './mapState';
import { StaticTile } from './staticTile';
import { type IResizableMapLayer } from '../types';
import { MapState } from '../mapState';
import { StaticTile } from '../staticTile';
vi.hoisted(() => {
vi.stubGlobal('main', { replayChecking: true });
@@ -13,9 +13,9 @@ import {
TileType
} from '@user/data-common';
import { DirectionMapper } from '@motajs/common';
import { type IResizableMapLayer } from './types';
import { MapState } from './mapState';
import { StaticTile } from './staticTile';
import { type IResizableMapLayer } from '../types';
import { MapState } from '../mapState';
import { StaticTile } from '../staticTile';
vi.hoisted(() => {
vi.stubGlobal('main', { replayChecking: true });