Skip to content

Commit 585e4f4

Browse files
committed
refactor(tests): reorganize test files into __tests__ directory and update imports
1 parent 4c4f2cd commit 585e4f4

15 files changed

+31
-31
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { describe, expect, it } from "bun:test";
2-
import { Archetype } from "./archetype";
3-
import { component, createEntityId, relation, type EntityId } from "./entity";
2+
import { Archetype } from "../archetype";
3+
import { component, createEntityId, relation, type EntityId } from "../entity";
44

55
describe("Archetype", () => {
66
type Position = { x: number; y: number };
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { describe, expect, it } from "bun:test";
2-
import { ComponentChangeset } from "./changeset";
3-
import { component } from "./entity";
2+
import { ComponentChangeset } from "../changeset";
3+
import { component } from "../entity";
44

55
describe("ComponentChangeset", () => {
66
const PositionId = component<{ x: number; y: number }>();
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { describe, expect, it } from "bun:test";
2-
import { CommandBuffer, type Command } from "./command-buffer";
3-
import type { EntityId } from "./entity";
2+
import { CommandBuffer, type Command } from "../command-buffer";
3+
import type { EntityId } from "../entity";
44

55
describe("CommandBuffer", () => {
66
it("should buffer commands and execute them", () => {

src/dont-fragment-query-notification.test.ts renamed to src/__tests__/dont-fragment-query-notification.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { describe, expect, it } from "bun:test";
2-
import { component, relation } from "./entity";
3-
import { World } from "./world";
2+
import { component, relation } from "../entity";
3+
import { World } from "../world";
44

55
describe("DontFragment Query Notification Issue", () => {
66
it("should notify queries when new archetypes with dontFragment relations are created", () => {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { describe, expect, it } from "bun:test";
2-
import { component, relation, type EntityId } from "./entity";
3-
import { World } from "./world";
2+
import { component, relation, type EntityId } from "../entity";
3+
import { World } from "../world";
44

55
describe("DontFragment Relations", () => {
66
it("should prevent archetype fragmentation for dontFragment relations", () => {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, expect, it } from "bun:test";
2-
import type { ComponentId, EntityId } from "./entity";
2+
import type { ComponentId, EntityId } from "../entity";
33
import {
44
component,
55
COMPONENT_ID_MAX,
@@ -24,7 +24,7 @@ import {
2424
isRelationId,
2525
isWildcardRelationId,
2626
relation,
27-
} from "./entity";
27+
} from "../entity";
2828

2929
describe("Entity ID System", () => {
3030
describe("Component IDs", () => {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { describe, expect, it } from "bun:test";
2-
import { component, relation } from "./entity";
3-
import { World } from "./world";
2+
import { component, relation } from "../entity";
3+
import { World } from "../world";
44

55
describe("World.getOptional", () => {
66
it("should return { value: T } when component exists", () => {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, expect, test } from "bun:test";
2-
import { MultiMap } from "./multi-map";
2+
import { MultiMap } from "../multi-map";
33

44
describe("MultiMap", () => {
55
test("add and get values", () => {
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { describe, expect, it } from "bun:test";
2-
import { Archetype } from "./archetype";
3-
import type { ComponentId, EntityId } from "./entity";
4-
import { relation } from "./entity";
5-
import { matchesComponentTypes, matchesFilter, type QueryFilter } from "./query-filter";
2+
import { Archetype } from "../archetype";
3+
import type { ComponentId, EntityId } from "../entity";
4+
import { relation } from "../entity";
5+
import { matchesComponentTypes, matchesFilter, type QueryFilter } from "../query-filter";
66

77
// Mock component IDs for testing
88
const positionComponent = 1 as ComponentId<{ x: number; y: number }>;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { World, component } from "./index";
1+
import { World, component } from "../index";
22

33
// 定义组件类型
44
type Position = { x: number; y: number };

0 commit comments

Comments
 (0)