-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Closed
Description
Version
1.50.1
Steps to reproduce
- Make a package that exports TS files to use them in tests
- Import a TS module from this package in any test file
Expected behavior
Imported external TS module from the package should work as any local module
Actual behavior
Imported external TS module doesn't work because Playwright tries to run it differently than the local ones
Additional context
The log of playwright test
shows:
SyntaxError: Unexpected token 'export'
at shared/utils/prepare-test.ts:1
> 1 | import { PlaywrightUtils } from '@company/fe-kit/static/utils/playwright';
| ^
2 |
3 | import { API_REGEX, INITIAL_REQUEST_DATA_MAP, WEBSOCKET_GLOB } from '../constants';
4 | import { PlaywrightTestArgs } from '@playwright/test';
at Object.<anonymous> (/Users/janealter/Projects/web-ui/e2e/shared/utils/prepare-test.ts:1:1)
at Object.<anonymous> (/Users/janealter/Projects/web-ui/e2e/shared/utils/index.ts:2:1)
at Object.<anonymous> (/Users/janealter/Projects/web-ui/e2e/Store Setup/Screens/Screen/Banners/Banner/image-pick.spec.ts:2:1)
The imported module is just a usual TS file with a few exports, nothing special
Environment
System:
OS: macOS 15.4
CPU: (12) arm64 Apple M3 Pro
Memory: 76.25 MB / 36.00 GB
Binaries:
Node: 22.11.0 - ~/.nvm/versions/node/v22.11.0/bin/node
npm: 10.9.0 - ~/.nvm/versions/node/v22.11.0/bin/npm
Languages:
Bash: 3.2.57 - /bin/bash
npmPackages:
@playwright/test: 1.50.1 => 1.50.1
playwright-test-coverage: 1.2.12 => 1.2.12
Metadata
Metadata
Assignees
Labels
No labels