Skip to content

test: resolve generator CLI file URL as a native path - #35

Merged
heoblitz merged 1 commit into
toss:mainfrom
MycroCosmo:fix/generator-test-file-url
Nov 12, 2026
Merged

heoblitz merged 1 commit into
toss:mainfrom
MycroCosmo:fix/generator-test-file-url

Conversation

@MycroCosmo

Copy link
Copy Markdown
Contributor

Summary

The generator CLI tests pass cli.pathname to Node, but a file URL pathname is not a native filesystem path. On Windows it produces a path such as C:\C:\... and all nine CLI tests fail with MODULE_NOT_FOUND before reaching the CLI. URL pathnames also retain percent-encoded spaces and non-ASCII characters.

Use fileURLToPath(cli) when spawning the CLI, matching the file URL handling already used in the generator implementation. This changes only the test helper.

Test Plan

Verified on Windows with Node.js 22.17.0:

  • Before the change: node --test WebPackages/CreateNectoPlugin/tests/cli.test.js — all 9 CLI tests fail with the invalid path.
  • npm --prefix WebPackages/CreateNectoPlugin test — all 13 tests pass.
  • Copied the generator package into directories containing spaces and Korean characters and ran node --test tests/cli.test.js tests/create-project.test.js — all 13 tests pass in each directory.
  • npm --prefix WebPackages/CreateNectoPlugin run build and npm --prefix WebPackages/CreateNectoPlugin run typecheck — the package's syntax checks pass.
  • git diff --check passes.

macOS/iOS builds, Swift tests, and device/USB checks were not run. The application and SDK are unchanged.

@heoblitz heoblitz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for fixing it!

@heoblitz
heoblitz merged commit adcf0ff into toss:main Nov 12, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants