Skip to content

[jules] feat: Add deeper tests for poml-vscode preview commands #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ultmaster
Copy link
Contributor

This commit introduces more comprehensive tests for the poml-vscode extension's preview functionality.

New tests in packages/poml-vscode/tests/command.test.ts verify that the commands:

  • poml.showPreview
  • poml.showPreviewToSide
  • poml.showLockedPreviewToSide result in a visible 'poml.preview' webview panel.

These tests currently fail, correctly identifying an issue within the extension: when using untitled documents (as the tests do), the preview panel fails to load, throwing an "Error: Request poml/preview failed with message: The URL must be of scheme file".

The test setup includes:

  • A workaround for extension activation (ensureExtensionActivatedOnce) due to persistent TypeScript/Mocha typing issues with beforeAll in the build environment.
  • Adjustments to .vscode-test.mjs for correct test discovery.
  • Ensuring npm run build-extension is run before tests.

The existing test in extension.test.ts (checking for command registration) continues to pass. The new failing tests serve as a valuable indicator of an area needing a bug fix in the extension.

This commit introduces more comprehensive tests for the poml-vscode extension's preview functionality.

New tests in `packages/poml-vscode/tests/command.test.ts` verify that the commands:
- `poml.showPreview`
- `poml.showPreviewToSide`
- `poml.showLockedPreviewToSide`
result in a visible 'poml.preview' webview panel.

These tests currently fail, correctly identifying an issue within the extension:
when using untitled documents (as the tests do), the preview panel fails to load,
throwing an "Error: Request poml/preview failed with message: The URL must be of scheme file".

The test setup includes:
- A workaround for extension activation (`ensureExtensionActivatedOnce`) due to persistent TypeScript/Mocha typing issues with `beforeAll` in the build environment.
- Adjustments to `.vscode-test.mjs` for correct test discovery.
- Ensuring `npm run build-extension` is run before tests.

The existing test in `extension.test.ts` (checking for command registration) continues to pass.
The new failing tests serve as a valuable indicator of an area needing a bug fix in the extension.
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.

1 participant