Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 6 additions & 19 deletions e2e/react-router-app/scripts/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,16 @@ function source(path: string): string {
return readFileSync(absolute, 'utf8');
}

// Fixture self-containment (no cross-fixture imports) is enforced for all
// e2e/* members by the fixture-sibling vector in scripts/verify/topology.ts
// (runs in verify:lint).
describe('React Router Worker canary structure', () => {
it('delegates the Worker to the generated server build', () => {
// The two anchors carry the invariant: the Worker still exercises React
// Router SSR rather than degenerating into a stub that would build and
// dry-run green.
const worker = source('workers/app.ts');
expect(worker).toContain('createRequestHandler');
expect(worker).toContain('virtual:react-router/server-build');
expect(worker).not.toContain('/api/health');
expect(worker).not.toContain('new URL');
expect(worker).toMatch(
/async fetch\(request: Request\): Promise<Response> \{\s*return requestHandler\(request\);\s*\}/
);
});

it('contains no cross-fixture imports', () => {
for (const path of [
'app/root.tsx',
'app/routes.ts',
'app/routes/home.tsx',
'app/routes/client.tsx',
'src/ds.ts',
'src/components.tsx',
'workers/app.ts',
]) {
expect(source(path)).not.toMatch(/e2e\/(next|vite|vinext)-app/);
}
});
});
27 changes: 0 additions & 27 deletions e2e/vinext-app/scripts/config.test.ts

This file was deleted.

10 changes: 0 additions & 10 deletions packages/_assertions/__tests__/conditions-inside-layers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,6 @@ describe('assertConditionsInsideLayers (Guardrail G2)', () => {
).not.toThrow();
});

it('passes even for nested sublayers (@layer composed inside @layer anm-variants)', () => {
// The `@container (min-width: 600px)` lives inside `@layer composed`, itself
// nested in `@layer anm-variants` — still "inside a named @layer block".
expect(() =>
assertConditionsInsideLayers(CONDITIONS_IN_LAYERS, {
atRules: ['@container'],
})
).not.toThrow();
});

it('fails when a @container rule appears outside any @layer block', () => {
const hoisted = `
@layer anm-base { .animus-Card { display: flex; } }
Expand Down
87 changes: 0 additions & 87 deletions packages/_assertions/__tests__/property-registration-split.test.ts

This file was deleted.

13 changes: 0 additions & 13 deletions packages/_assertions/__tests__/receipt.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,6 @@ describe('writeLaneReceipt', () => {
engineOverride: false,
packageForm: 'workspace',
});
// Explicitly prove every one of the eight fields survived.
for (const key of [
'lane',
'host',
'hostVersion',
'mode',
'engineLoaded',
'engineDefault',
'engineOverride',
'packageForm',
] as const) {
expect(parsed).toHaveProperty(key);
}
});

it('creates missing parent directories and appends a trailing newline', () => {
Expand Down
77 changes: 0 additions & 77 deletions packages/_assertions/src/assert-css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,83 +155,6 @@ export function assertNoUnresolvedTokens(
}
}

/** The three structured parts returned by `assembleStylesheet({ split: true })`. */
export interface SplitStylesheetParts {
declaration: string;
variables: string;
body: string;
}

/**
* Assert the property-registration split contract (stylesheet-assembly delta,
* "Property registration rules contained in the variables part"):
*
* - `@property` rules live in the `variables` part (at least one present),
* - the `body` part contains none,
* - the `declaration` part is only the `@layer` ordering statement (no
* `@property`), and
* - rejoining the parts reproduces the non-split output — the same
* `[declaration, variables, body].filter(Boolean).join('\n')` that
* `assembleStylesheet` returns without `split`.
*
* Pure over the split parts + the non-split string; no I/O.
*/
export function assertPropertyRegistrationSplit(
parts: SplitStylesheetParts,
nonSplit: string
): void {
const countProperties = (css: string): number =>
(css.match(/@property\b/g) ?? []).length;

const inVariables = countProperties(parts.variables);
const inBody = countProperties(parts.body);
const inDeclaration = countProperties(parts.declaration);

if (inVariables < 1) {
throw new AssertionError(
'assertPropertyRegistrationSplit: expected @property rule(s) in the variables part, found none',
{ inVariables, inBody, inDeclaration }
);
}
if (inBody !== 0) {
throw new AssertionError(
`assertPropertyRegistrationSplit: body part must contain no @property rules, found ${inBody}`,
{ inBody }
);
}
if (inDeclaration !== 0) {
throw new AssertionError(
`assertPropertyRegistrationSplit: declaration part must contain no @property rules, found ${inDeclaration}`,
{ inDeclaration }
);
}
if (!LAYER_DECLARATION_RE.test(parts.declaration)) {
throw new AssertionError(
'assertPropertyRegistrationSplit: declaration part must contain the @layer ordering statement',
{ declaration: parts.declaration }
);
}
// "Only the @layer ordering statement": nothing may remain once the
// ordering statement is removed (spec: declaration part SHALL remain
// only the @layer ordering statement).
if (parts.declaration.replace(LAYER_DECLARATION_RE, '').trim() !== '') {
throw new AssertionError(
'assertPropertyRegistrationSplit: declaration part must contain ONLY the @layer ordering statement',
{ declaration: parts.declaration }
);
}

const rejoined = [parts.declaration, parts.variables, parts.body]
.filter(Boolean)
.join('\n');
if (rejoined !== nonSplit) {
throw new AssertionError(
'assertPropertyRegistrationSplit: rejoined split parts do not equal the non-split output',
{ rejoined, nonSplit }
);
}
}

/** All `@layer <name> { … }` block spans (single-name block opens, brace-
* matched). The layer DECLARATION statement (`@layer a, b, c;`) is not a block
* and is excluded. Nested sublayers (`@layer composed { … }`) are included. */
Expand Down
2 changes: 1 addition & 1 deletion packages/_integration/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Covers color tokens only. Scale tokens (font, space) resolve to literals not var

| File | What it tests |
| ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `extraction.test.ts` | Variant resolution, compound resolution, transforms, system props, responsive, multi-file |
| `extraction.test.ts` | Variant resolution, compound resolution, transforms, responsive, multi-file (system_prop_map content is pinned by `manifest-shape.test.ts`) |
| `serialization.test.ts` | Round-trip: serialize() → analyzeProject() → valid manifest |
| `composition.test.ts` | compose() through full pipeline, slot CSS, shared variants |
| `post-processing.test.ts` | applyUnitFallback, applyPrefix, assembleStylesheet coverage (v1-era resolveGlobalStyles/resolveTokenAliases/resolveTransformPlaceholders helpers were deleted with retire-extract-v1 cleanup — the Rust v2 engine owns that resolution) |
Expand Down
12 changes: 0 additions & 12 deletions packages/_integration/__tests__/extraction.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,18 +135,6 @@ describe('transform resolution', () => {
});
});

// ─── System Props ────────────────────────────────────────────

describe('system props extraction', () => {
test('produces system_prop_map in manifest', () => {
const entry = readFixtureFile(COMPONENTS, 'system-props.tsx');
const { manifest } = runPipeline([entry]);

expect(manifest.system_prop_map).toBeDefined();
expect(manifest.system_prop_map).toEqual(expect.any(Object));
});
});

// ─── Responsive Extraction ───────────────────────────────────

describe('responsive extraction', () => {
Expand Down
35 changes: 13 additions & 22 deletions packages/_integration/__tests__/manifest-shape.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,28 +223,20 @@ describe('component descriptor completeness', () => {
);

test('manifest.components is a non-empty object', () => {
expect(manifest.components).toEqual(expect.any(Object));
// Non-empty: the vacuity anchor for the descriptor loop below.
expect(Object.keys(manifest.components).length).toBeGreaterThan(0);
});

test('every component descriptor has required non-empty fields', () => {
// The manifest decoder already guarantees string types; non-emptiness
// (and the class_name prefix) is the claim here.
for (const [id, descriptor] of Object.entries(manifest.components)) {
expect(descriptor.file).toEqual(expect.any(String));
expect(descriptor.file.length).toBeGreaterThan(0);
expect(descriptor.binding).toEqual(expect.any(String));
expect(descriptor.binding.length).toBeGreaterThan(0);
expect(descriptor.class_name).toEqual(expect.any(String));
expect(descriptor.class_name).toMatch(/^animus-/);
expect(descriptor.replacement).toEqual(expect.any(String));
expect(descriptor.replacement.length).toBeGreaterThan(0);
expect(descriptor.tag).toEqual(expect.any(String));
expect(descriptor.tag.length).toBeGreaterThan(0);
expect(Object.prototype.toString.call(descriptor.terminal)).toBe(
'[object String]'
);
expect(descriptor.terminal.length).toBeGreaterThan(0);
// id should be a non-empty string and match the key
expect(id.length).toBeGreaterThan(0);
expect(descriptor.class_name).toMatch(/^animus-/);
const emptyFields = (
['file', 'binding', 'replacement', 'tag', 'terminal'] as const
).filter((field) => descriptor[field].length === 0);
expect(emptyFields).toEqual([]);
}
});
});
Expand All @@ -255,9 +247,9 @@ describe('files-to-components consistency', () => {
);

test('every component_id in manifest.files exists in manifest.components', () => {
expect(manifest.files).toEqual(expect.any(Object));
// Non-empty: the vacuity anchor for the loop below.
expect(Object.keys(manifest.files).length).toBeGreaterThan(0);
for (const [filePath, componentIds] of Object.entries(manifest.files)) {
expect(Array.isArray(componentIds)).toBe(true);
for (const id of componentIds) {
expect(manifest.components[id]).toBeDefined();
expect(manifest.components[id].file).toBe(filePath);
Expand All @@ -273,7 +265,7 @@ describe('provenance reciprocity', () => {

test('reverse_provenance is reciprocal with extends_from', () => {
const reverse = manifest.reverse_provenance;
expect(reverse).toEqual(expect.any(Object));
expect(Object.keys(reverse).length).toBeGreaterThan(0);
for (const [parentId, childIds] of Object.entries(reverse)) {
expect(manifest.components[parentId]).toBeDefined();
for (const childId of childIds) {
Expand Down Expand Up @@ -359,10 +351,9 @@ describe('system_prop_map validation', () => {
);

test('system_prop_map is populated for used props', () => {
expect(manifest.system_prop_map).toEqual(expect.any(Object));
// system-props.tsx uses p, mt, display, color — at minimum p and mt should appear.
// system-props.tsx uses p, mt, display, color — at minimum p should
// appear. This is the vacuity anchor for the class-name loop below.
expect(manifest.system_prop_map.p).toBeDefined();
expect(manifest.system_prop_map.p).toEqual(expect.any(Object));
});

test('all system_prop_map class name values are animus-u- prefixed', () => {
Expand Down
11 changes: 1 addition & 10 deletions packages/_integration/__tests__/mdx-preprocessing.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import {
DEFAULT_EXTENSIONS,
preprocessMdx,
type PreprocessMdxResult,
} from '@animus-ui/extract/pipeline';
import { DEFAULT_EXTENSIONS, preprocessMdx } from '@animus-ui/extract/pipeline';
import { describe, expect, test } from 'vitest';

/**
Expand Down Expand Up @@ -90,11 +86,6 @@ describe('preprocessMdx — compile failure (kind: "error")', () => {
});

describe('preprocessMdx — result shape contract (PreprocessMdxResult)', () => {
test('kind is always one of the documented union members', async () => {
const result: PreprocessMdxResult = await preprocessMdx('# ok\n', 'x.mdx');
expect(['ok', 'missing-dep', 'error']).toContain(result.kind);
});

/**
* Honestly-unreachable branch — DOCUMENTED GAP.
*
Expand Down
Loading