Skip to content

[BUG] Tests fail on the latest Node.js versions 25, 26 #173

Description

@MurzNN

Describe the bug
Tried to make a PR with a simple fix #172 but could not push it because of the git hooks and failed tests. After having hard times, found out that downgrading to Node 24 resolves the issue.

To Reproduce
Run tests on Node 25/26, and see an error:

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Failed Tests 17 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

 FAIL  packages/form-builder-react/src/context/builder-context.test.tsx > Builder Context > provides store and registry to children
 FAIL  packages/form-builder-react/src/context/builder-context.test.tsx > Builder Context > provides renderIcon to children
 FAIL  packages/form-builder-react/src/context/builder-context.test.tsx > Builder Context > throws error when used outside provider
 FAIL  packages/form-builder-react/src/context/builder-context.test.tsx > Builder Context > useBuilderStore reacts to state changes
 FAIL  packages/form-builder-react/src/context/builder-context.test.tsx > Builder Context > useSelectedNode returns node when selected
TypeError: Cannot read properties of undefined (reading 'clear')
 ❯ packages/form-builder-react/src/context/builder-context.test.tsx:23:18
     21| describe("Builder Context", () => {
     22|   beforeEach(() => {
     23|     localStorage.clear();
       |                  ^
     24|   });
     25|

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/17]⎯

 FAIL  packages/form-builder-react/src/components/primitives.test.tsx > Headless Components Smoke Tests > BuilderCanvas renders root nodes
 FAIL  packages/form-builder-react/src/components/primitives.test.tsx > Headless Components Smoke Tests > BuilderSidebar provides grouped fields
 FAIL  packages/form-builder-react/src/components/primitives.test.tsx > Headless Components Smoke Tests > BuilderProperties provides selection context
 FAIL  packages/form-builder-react/src/components/primitives.test.tsx > Headless Components Smoke Tests > BuilderProperties provides form settings when no node is selected
TypeError: Cannot read properties of undefined (reading 'clear')
 ❯ packages/form-builder-react/src/components/primitives.test.tsx:24:18
     22| describe("Headless Components Smoke Tests", () => {
     23|   beforeEach(() => {
     24|     localStorage.clear();
       |                  ^
     25|   });
     26|

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/17]⎯

 FAIL  packages/form-builder-react/src/state/store.test.ts > Builder Store > initializes with default state
 FAIL  packages/form-builder-react/src/state/store.test.ts > Builder Store > can create and select a node
 FAIL  packages/form-builder-react/src/state/store.test.ts > Builder Store > updates node properties
 FAIL  packages/form-builder-react/src/state/store.test.ts > Builder Store > moves nodes within roots
 FAIL  packages/form-builder-react/src/state/store.test.ts > Builder Store > removes a node and cleans up state
 FAIL  packages/form-builder-react/src/state/store.test.ts > Builder Store > duplicates a node
 FAIL  packages/form-builder-react/src/state/store.test.ts > Builder Store > updates UI state
 FAIL  packages/form-builder-react/src/state/store.test.ts > Builder Store > supports undo/redo
TypeError: Cannot read properties of undefined (reading 'clear')
 ❯ packages/form-builder-react/src/state/store.test.ts:38:18
     36| describe("Builder Store", () => {
     37|   beforeEach(() => {
     38|     localStorage.clear();
       |                  ^
     39|     vi.useFakeTimers();
     40|   });

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/17]⎯


 Test Files  3 failed | 62 passed (65)
      Tests  17 failed | 712 passed (729)

Expected behavior
They should work :)

Environment (please complete the following information):

  • OS: Linux
  • Browser: CLI
  • commit dd172be (tag: @buildnbuzz/form-react@0.1.13, tag: @buildnbuzz/form-core@0.1.12,origin/main, origin/HEAD, fork/main, fork/HEAD, main)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions