feat: Blender-authored roadside districts that rise per chapter
This commit is contained in:
@@ -62,6 +62,7 @@ describe('release budgets', () => {
|
||||
expect(classifyArtifact('assets/index-a.js', 'import("./environment-b.js")')).toBe('initial-application-js');
|
||||
expect(classifyArtifact('assets/environment-b.js', 'three scene')).toBe('first-live-scene');
|
||||
expect(classifyArtifact('assets/nightdrive-grand-tourer-a.glb', '')).toBe('first-live-scene');
|
||||
expect(classifyArtifact('assets/nightdrive-districts-a.glb', '')).toBe('first-live-scene');
|
||||
expect(classifyArtifact('assets/nightdrive-main.opus', '')).toBe('soundtrack-audio');
|
||||
expect(classifyArtifact('assets/nightdrive-intro.mp3', '')).toBe('soundtrack-audio');
|
||||
expect(classifyArtifact('assets/nightdrive-afterglow.opus', '')).toBe('soundtrack-audio');
|
||||
|
||||
32
tests/unit/districts.test.ts
Normal file
32
tests/unit/districts.test.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { readFileSync } from "node:fs";
|
||||
import { DISTRICT_PRESENCE } from "@/scene/world/districts";
|
||||
|
||||
const provenance = JSON.parse(
|
||||
readFileSync("assets/blender/districts/nightdrive-districts.asset.json", "utf8"),
|
||||
) as { pieces: string[]; triangles: number };
|
||||
|
||||
describe("roadside districts", () => {
|
||||
it("raises every authored piece in at least one chapter and nothing else", () => {
|
||||
expect(Object.keys(DISTRICT_PRESENCE).sort()).toEqual(provenance.pieces);
|
||||
for (const presence of Object.values(DISTRICT_PRESENCE)) {
|
||||
const strengths = Object.values(presence);
|
||||
expect(strengths.length).toBeGreaterThan(0);
|
||||
for (const strength of strengths) {
|
||||
expect(strength).toBeGreaterThan(0);
|
||||
expect(strength).toBeLessThanOrEqual(1);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
it("keeps the opening and the destination clear of mid-route districts", () => {
|
||||
for (const [piece, presence] of Object.entries(DISTRICT_PRESENCE)) {
|
||||
expect(presence.start, piece).toBeUndefined();
|
||||
if (piece !== "arch") expect(presence.contact, piece).toBeUndefined();
|
||||
}
|
||||
});
|
||||
|
||||
it("stays a light kit", () => {
|
||||
expect(provenance.triangles).toBeLessThan(8000);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user