-
Notifications
You must be signed in to change notification settings - Fork 669
-
Notifications
You must be signed in to change notification settings - Fork 669
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
Error: TypeScript compilation failed. /tests/commonFunctions.ts (2, 26): Cannot find module 'process'. /tests/commonFunctions.ts (4, 14): Cannot find name 'require' #4437
Comments
Thank you for the provided information. I've reproduced the problem. |
Still getting the above isuue with latest docker image (ID: 3ee5563f19df) Error: TypeScript compilation failed. |
The fix for this issue is not included in |
This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow. |
Are you requesting a feature or reporting a bug?
What is your Test Scenario?
Simple test to open webpage and login
The IP where the page is located should be provided through environment variables.which retrived in the script using "process" and "require".
The tests should run inside a Docker container
The tests are written with typescript
What is the Current behavior?
ERROR Cannot prepare tests due to an error.
Error: TypeScript compilation failed.
/tests/commonFunctions.ts (2, 26): Cannot find module 'process'.
/tests/commonFunctions.ts (4, 14): Cannot find name 'require'. Do you need to install type definitions for node? Try
npm i @types/node
./tests/commonFunctions.ts (91, 22): Cannot find name 'require'. Do you need to install type definitions for node? Try
npm i @types/node
./tests/login.ts (3, 14): Cannot find name 'require'. Do you need to install type definitions for node? Try
npm i @types/node
./tests/test.ts (6, 17): Cannot find name 'process'. Do you need to install type definitions for node? Try
npm i @types/node
.What is the Expected behavior?
Typescript should execute,
The same script was running fine with testcafe@1.4.3 docker image
How would you reproduce the current behavior (if this is a bug)?
Create a simple test that uses environment variables and is written in typescript
Run: docker run -v /home/.../src/main/client/:/tests -it testcafe/testcafe firefox /tests/**/*testcafe.ts
See the error...
Provide the test code and the tested page URL (if applicable)
import { Selector } from "testcafe";
var config = require('./loginDetails.json');
fixture("Getting Started");
test('test', async t => {
console.log(
${process.env.HOSTNAME}
);});
loginDetails.json file:
{
"URL": {
"qaUrl": "http://127.0.0.1:3001"
}
}
Your website URL (or attach your complete example):
Your complete test code (or attach your test files)
import { Selector } from "testcafe";
var config = require('./loginDetails.json');
fixture("Getting Started");
test('test', async t => {
console.log(
${process.env.HOSTNAME}
);});
The text was updated successfully, but these errors were encountered: