LearnNewsExamplesServices
Frontmatter
id7262
titleEnhance Development Workflow with Mandatory Unit Testing
stateClosed
labels
enhancementepic
assigneestobiu
createdAtSep 27, 2025, 1:14 PM
updatedAtNov 4, 2025, 11:56 AM
githubUrlhttps://github.com/neomjs/neo/issues/7262
authortobiu
commentsCount1
parentIssuenull
subIssues
7256 Refactor Playwright Setup Function for Test-Specific Configurations
7261 Convert core/Effect.mjs Siesta Test to Playwright
7260 Correct Playwright Output Directory
7258 Refactor Playwright Setup and Convert VdomHelper Test
7255 Refactor Playwright Test Configuration
7254 Install Playwright and Convert First Siesta Test
7263 Plan Remaining Siesta to Playwright Test Migrations
7267 Convert ClassConfigsAndFields.mjs Test from Siesta to Playwright
7268 Convert ClassSystem.mjs Test from Siesta to Playwright
7269 Convert CollectionBase.mjs Test from Siesta to Playwright
7270 Convert ManagerInstance.mjs Test from Siesta to Playwright
7271 Convert Rectangle.mjs Test from Siesta to Playwright
7272 Convert VdomCalendar.mjs Test from Siesta to Playwright
7273 Convert config/AfterSetConfig.mjs Test from Siesta to Playwright
7274 Convert config/Basic.mjs Test from Siesta to Playwright
7275 Convert config/CircularDependencies.mjs Test from Siesta to Playwright
7276 Convert config/CustomFunctions.mjs Test from Siesta to Playwright
7277 Convert config/Hierarchy.mjs Test from Siesta to Playwright
7278 Convert config/MemoryLeak.mjs Test from Siesta to Playwright
7279 Convert config/MultiLevelHierarchy.mjs Test from Siesta to Playwright
7280 Convert core/EffectBatching.mjs Test from Siesta to Playwright
7281 Convert form/field/AfterSetValueSequence.mjs Test from Siesta to Playwright
7282 Convert functional/Button.mjs Test from Siesta to Playwright
7283 Convert functional/HtmlTemplateComponent.mjs Test from Siesta to Playwright
7284 Convert functional/Parse5Processor.mjs Test from Siesta to Playwright
7285 Convert neo/MixinStaticConfig.mjs Test from Siesta to Playwright
7286 Convert state/createHierarchicalDataProxy.mjs Test from Siesta to Playwright
7287 Convert state/FeedbackLoop.mjs Test from Siesta to Playwright
7288 Convert state/Provider.mjs Test from Siesta to Playwright
7289 Convert state/ProviderNestedDataConfigs.mjs Test from Siesta to Playwright
7290 Convert vdom/Advanced.mjs Test from Siesta to Playwright
7291 Convert vdom/VdomAsymmetricUpdates.mjs Test from Siesta to Playwright
7292 Convert vdom/VdomRealWorldUpdates.mjs Test from Siesta to Playwright
7293 Convert vdom/layout/Cube.mjs Test from Siesta to Playwright
7294 Convert vdom/table/Container.mjs Test from Siesta to Playwright
subIssuesCompleted35
subIssuesTotal35
blockedBy[]
blocking[]
closedAtNov 4, 2025, 11:56 AM

Enhance Development Workflow with Mandatory Unit Testing

Closed v11.0.0 enhancementepic
tobiu
tobiu commented on Sep 27, 2025, 1:14 PM

Scope

This epic outlines the plan to improve the stability of the Neo.mjs framework and enforce API consistency by integrating a mandatory testing step into the development workflow for all contributors, including AI agents.

The primary goal is to prevent regressions, especially in the complex core modules, and to ensure that all public-facing APIs (including configs) remain stable.

Top-Level Items

  1. Migrate Unit Tests to a Node.js Runner:

    • Systematically migrate the entire suite of unit tests from the browser-based Siesta harness to the Node.js-based Playwright runner.
    • This makes the tests scriptable and executable from the command line, enabling automation.
  2. Update Agent Workflow (AGENTS.md):

    • Amend the agent guidelines to include a new, mandatory step in the "Implementation Loop".
    • Before any actionable ticket concerning stable, non-experimental code is considered complete, the agent must run the full Playwright unit test suite and confirm that all tests pass.
    • This ensures that no change, however small, introduces a regression or an unintended API modification.

Migration Guide & Best Practices

CRITICAL: All contributors (human or AI) assigned to a test migration task MUST follow these instructions to ensure consistency and prevent regressions.

  1. Analyze Existing Examples: Before starting, thoroughly review the already completed Playwright test test/playwright/unit/VdomHelper.spec.mjs and its original Siesta counterpart test/siesta/tests/VdomHelper.mjs. This will provide the blueprint for structure, assertions, and setup.

  2. Do Not Remove Core Imports: The Playwright unit tests run in a Node.js environment, not a browser. They require explicit imports to set up the Neo.mjs environment.

        import Neo from '../../../src/Neo.mjs';
    import * as core from '../../../src/core/_export.mjs';

    Even if these imports appear "unused" in the test file, they are ESSENTIAL. They attach the Neo namespace to the globalThis object. Removing them will cause the test environment to fail. DO NOT REMOVE THEM.

  3. Follow the Test Structure:

    • Use test.describe() to group tests for a class.
    • Use test() for individual test cases.
    • Use expect() from Playwright for assertions (toEqual, toBe, etc.).
  4. Update Status: Once a migration is complete and verified with npm test, update the status of the corresponding ticket to "Done" and, if possible, update its status in this epic.

  5. Add Intent-Driven JSDoc: At the top of the main test.describe() block for the test suite, add a JSDoc comment block. This block should include:

    • A @summary tag explaining the primary purpose of the test suite.
    • A brief description of what aspects of the class are being tested and why they are important.
  6. Always Re-Assign After setupClass: When defining a class locally for a test, you MUST re-assign the class variable to the return value of Neo.setupClass(). This ensures you are using the final, fully processed constructor. Failure to do so can lead to subtle inheritance bugs in the Node.js test environment.

    Correct:

        class MyTestClass extends Base { /* ... */ }
    MyTestClass = Neo.setupClass(MyTestClass); // Re-assignment is crucial

    Incorrect:

        class MyTestClass extends Base { /* ... */ }
    Neo.setupClass(MyTestClass); // Missing re-assignment
tobiu assigned to @tobiu on Sep 27, 2025, 1:14 PM
tobiu added the enhancement label on Sep 27, 2025, 1:14 PM
tobiu added the epic label on Sep 27, 2025, 1:14 PM
tobiu added sub-issue #7256 on Sep 27, 2025, 1:16 PM
tobiu added sub-issue #7261 on Sep 27, 2025, 1:16 PM
tobiu added sub-issue #7260 on Sep 27, 2025, 1:16 PM
tobiu added sub-issue #7258 on Sep 27, 2025, 1:17 PM
tobiu added sub-issue #7255 on Sep 27, 2025, 1:18 PM
tobiu added sub-issue #7254 on Sep 27, 2025, 1:18 PM
tobiu added sub-issue #7263 on Sep 27, 2025, 1:19 PM
tobiu referenced in commit 0c4d5d2 - "#7262 Internal tickets" on Sep 27, 2025, 1:20 PM
tobiu added sub-issue #7266 on Sep 27, 2025, 2:05 PM
tobiu referenced in commit b21e045 - "#7262 Internal tickets" on Sep 27, 2025, 2:06 PM
tobiu added sub-issue #7267 on Sep 27, 2025, 2:33 PM
tobiu added sub-issue #7268 on Sep 27, 2025, 2:36 PM
tobiu added sub-issue #7269 on Sep 27, 2025, 2:37 PM
tobiu added sub-issue #7270 on Sep 27, 2025, 2:39 PM
tobiu added sub-issue #7271 on Sep 27, 2025, 2:40 PM
tobiu added sub-issue #7272 on Sep 27, 2025, 2:47 PM
tobiu added sub-issue #7273 on Sep 27, 2025, 3:17 PM
tobiu added sub-issue #7274 on Sep 27, 2025, 3:19 PM
tobiu added sub-issue #7275 on Sep 27, 2025, 3:33 PM
tobiu added sub-issue #7276 on Sep 27, 2025, 3:34 PM
tobiu added sub-issue #7277 on Sep 27, 2025, 3:36 PM
tobiu added sub-issue #7278 on Sep 27, 2025, 3:37 PM
tobiu added sub-issue #7279 on Sep 27, 2025, 3:39 PM
tobiu added sub-issue #7280 on Sep 27, 2025, 3:40 PM
tobiu added sub-issue #7281 on Sep 27, 2025, 3:52 PM
tobiu added sub-issue #7282 on Sep 27, 2025, 3:54 PM
tobiu added sub-issue #7283 on Sep 27, 2025, 3:55 PM
tobiu added sub-issue #7284 on Sep 27, 2025, 3:56 PM
tobiu added sub-issue #7285 on Sep 27, 2025, 3:57 PM
tobiu added sub-issue #7286 on Sep 27, 2025, 3:58 PM
tobiu added sub-issue #7287 on Sep 27, 2025, 3:59 PM
tobiu added sub-issue #7288 on Sep 27, 2025, 4:01 PM
tobiu added sub-issue #7289 on Sep 27, 2025, 4:02 PM
tobiu added sub-issue #7290 on Sep 27, 2025, 4:04 PM
tobiu added sub-issue #7291 on Sep 27, 2025, 4:05 PM
tobiu added sub-issue #7292 on Sep 27, 2025, 4:06 PM
tobiu added sub-issue #7293 on Sep 27, 2025, 4:07 PM
tobiu added sub-issue #7294 on Sep 27, 2025, 4:09 PM
tobiu referenced in commit bfd1bf2 - "#7262 epic update => migration guide" on Sep 27, 2025, 4:41 PM
tobiu referenced in commit f9c97b4 - "#7262 changed Button test filename to upper case, ClassConfigsAndFields.spec.mjs: reassigned classes when calling setupClass() for consistency" on Sep 30, 2025, 12:37 PM
tobiu referenced in commit d9c4d4b - "#7262 updated internal tickets" on Oct 2, 2025, 9:57 PM
tobiu removed sub-issue #7266 on Nov 4, 2025, 11:56 AM
tobiu
tobiu Nov 4, 2025, 11:56 AM

resolved.

tobiu closed this issue on Nov 4, 2025, 11:56 AM