Tighten layer graph tests and document npm test typecheck.

Content and People/Schedule/Ai now fail the same way if they grow a game-layer edge the projects.md graph forbids; README matches the tsc-then-vitest script from phase 57.
This commit is contained in:
Leonid Pershin
2026-08-20 14:04:35 +03:00
parent f381475566
commit e2e7d30701
3 changed files with 24 additions and 3 deletions
+2 -1
View File
@@ -107,7 +107,8 @@ dotnet test
npm --prefix src/HSchool.Client test npm --prefix src/HSchool.Client test
``` ```
Vitest covers the client codec, the calendar formatting and the RU/EN dictionaries. `npm test` runs `tsc -b` then Vitest (codec, calendar formatting, RU/EN dictionaries). A duplicate
key in `strings.ts` fails typecheck without `npm run build`. `test:watch` is Vitest only.
## Layout ## Layout
@@ -33,6 +33,10 @@ describe('npm test script', () => {
it('does not depend on the hschool-client file: loop', () => { it('does not depend on the hschool-client file: loop', () => {
expect(pkg.dependencies?.['hschool-client']).toBeUndefined(); expect(pkg.dependencies?.['hschool-client']).toBeUndefined();
}); });
it('keeps build as typecheck then vite, without the file: loop', () => {
expect(pkg.scripts.build).toBe('tsc -b && vite build');
});
}); });
describe('duplicate dictionary keys', () => { describe('duplicate dictionary keys', () => {
@@ -40,11 +40,14 @@ public class LayerBoundaryTests
} }
[Fact] [Fact]
public void Content_DoesNotReferenceArchAspNetSocketsProtocolOrSimulation() public void Content_DoesNotReferenceArchAspNetSocketsProtocolPeopleScheduleAiOrSimulation()
{ {
var names = References(typeof(MapLayout)); var names = References(typeof(MapLayout));
AssertNoArchAspNetOrSockets(names); AssertNoArchAspNetOrSockets(names);
Assert.DoesNotContain("HSchool.Protocol", names, StringComparer.Ordinal); Assert.DoesNotContain("HSchool.Protocol", names, StringComparer.Ordinal);
Assert.DoesNotContain("HSchool.People", names, StringComparer.Ordinal);
Assert.DoesNotContain("HSchool.Schedule", names, StringComparer.Ordinal);
Assert.DoesNotContain("HSchool.Ai", names, StringComparer.Ordinal);
Assert.DoesNotContain("HSchool.Simulation", names, StringComparer.Ordinal); Assert.DoesNotContain("HSchool.Simulation", names, StringComparer.Ordinal);
} }
@@ -54,7 +57,10 @@ public class LayerBoundaryTests
[InlineData(typeof(WalkGraph))] [InlineData(typeof(WalkGraph))]
public void PeopleScheduleAi_DoNotReferenceArchAspNetOrSockets(Type marker) public void PeopleScheduleAi_DoNotReferenceArchAspNetOrSockets(Type marker)
{ {
AssertNoArchAspNetOrSockets(References(marker)); var names = References(marker);
AssertNoArchAspNetOrSockets(names);
Assert.DoesNotContain("HSchool.Protocol", names, StringComparer.Ordinal);
Assert.DoesNotContain("HSchool.Simulation", names, StringComparer.Ordinal);
} }
[Fact] [Fact]
@@ -83,6 +89,16 @@ public class LayerBoundaryTests
} }
} }
[Fact]
public void ArchitectureTests_DoNotReferenceHostOrNetArchTest()
{
var csproj = File.ReadAllText(
Path.Combine(RepoRoot(), "tests", "HSchool.Architecture.Tests", "HSchool.Architecture.Tests.csproj"));
Assert.DoesNotContain("HSchool.Server", csproj, StringComparison.Ordinal);
Assert.DoesNotContain("HSchool.AppHost", csproj, StringComparison.Ordinal);
Assert.DoesNotContain("NetArchTest", csproj, StringComparison.OrdinalIgnoreCase);
}
[Fact] [Fact]
public void PeopleAiScheduleSimulationTests_NoLongerCarryLayerBans() public void PeopleAiScheduleSimulationTests_NoLongerCarryLayerBans()
{ {