Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
jest-environment-lambdatest
Advanced tools
Use Jest as test-runner for running your visual-tests and more using LambdaTest.
For using this environment, run first the following command in your terminal:
npm install --save-dev jest-environment-lambdatest
Once it's done, configure your Jest config.
Assuming your configuration is defined in your package.json
, add the following lines to your globals
definition:
{
"jest": {
"preset": "ts-jest",
"testEnvironment": "lambdatest",
"globals": {
"lambdatest": {
"capabilities": {
"build": "jest and lambdatest with tunnel",
"name": "jest demo",
"platform": "Windows 10",
"browserName": "Chrome",
"version": "80.0"
}
}
}
}
}
Assuming here also your configuration is defined in your package.json
, add the following lines to your globals
definition:
{
"jest": {
"preset": "ts-jest",
"testEnvironment": "lambdatest",
"globals": {
"lambdatest": {
"capabilities": {
"build": "jest and lambdatest with tunnel",
"name": "jest demo",
"platform": "Windows 10",
"browserName": "Chrome",
"version": "80.0",
"tunnel": true
},
"tunnelOpts": {}
}
}
}
}
If you are running all your tests with JSDom as main environment, you can load the LambdaTest environment for a specific file by adding a Jest annotation at the beginning of your file.
Here is an example:
my-visual-test.spec.js:
/**
* @jest-environment-lambdatest
*/
import { By } from 'selenium-webdriver';
describe('my visual test', () => {
let driver;
beforeAll(async () => {
// you can override the default configuration
driver = await global.__driver__({
build: 'jest and lambdatest',
name: 'jest demo',
platform: 'Windows 10',
browserName: 'Chrome',
version: '80.0',
});
driver.get('https://www.lambdatest.com');
}, 20000); // this timeout is required because starting a session in LambdaTest can take ages
afterAll(async () => {
// can be omitted
await driver.quit();
});
it('test title', async () => {
const title = await driver.getTitle();
expect(title).toBe('Cross Browser Testing Tools | Free Automated Website Testing | LambdaTest');
});
});
If you aren't willing to put your credentials in your package.json
file, you can export in your environment LT_USERNAME
and LT_ACCESS_KEY
. If you do so, userName
and accessKey
can be omitted.
In the examples
folder, you can find an example using react-create-app
.
To run the test, type the following commands in your terminal:
cd examples/with-lambdatest-tunnel
yarn install
yarn test
The test
script will run a basic e2e tests, a visual tests making a snapshot of the web-app and the unit-tests.
Our GitHub Issue Tracker will help you log bug reports.
Tips for submitting an issue: Keep in mind, you don't end up submitting two issues with the same information. Make sure you add a unique input in every issue that you submit. You could also provide a "+1" value in the comments.
Always provide the steps to reproduce before you submit a bug. Provide the environment details where you received the issue i.e. Browser Name, Browser Version, Operating System, Screen Resolution and more. Describe the situation that led to your encounter with bug. Describe the expected output, and the actual output precisely.
We don't want to pull breaks in case you want to customize your LambdaTest experience. Before you proceed with implementing pull requests, keep in mind the following. Make sure you stick to coding conventions. Once you include tests, ensure that they all pass. Make sure to clean up your Git history, prior your submission of a pull-request. You can do so by using the interactive rebase command for committing and squashing, simultaneously with minor changes + fixes into the corresponding commits.
LambdaTest is a cloud based selenium grid infrastructure that can help you run automated cross browser compatibility tests on 2000+ different browser and operating system environments. LambdaTest supports all programming languages and frameworks that are supported with Selenium, and have easy integrations with all popular CI/CD platforms. It's a perfect solution to bring your selenium automation testing to cloud based infrastructure that not only helps you increase your test coverage over multiple desktop and mobile browsers, but also allows you to cut down your test execution time by running tests on parallel.
FAQs
an environment for using LambdaTest with Jest
The npm package jest-environment-lambdatest receives a total of 12 weekly downloads. As such, jest-environment-lambdatest popularity was classified as not popular.
We found that jest-environment-lambdatest demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.