A Systematic Evaluation of Environmental Flakiness in JavaScript Tests

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Hashemi, Negar, Tahir, Amjed, Shi, August, Rasheed, Shawn, Blagojevic, Rachel
Format: Preprint
Published: 2026
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866908847206039552
author Hashemi, Negar
Tahir, Amjed
Shi, August
Rasheed, Shawn
Blagojevic, Rachel
author_facet Hashemi, Negar
Tahir, Amjed
Shi, August
Rasheed, Shawn
Blagojevic, Rachel
contents Test flakiness is a significant issue in industry, affecting test efficiency and product quality. While extensive research has examined the impact of flaky tests, many root causes remain unexplored, particularly in the context of dynamic languages such as JavaScript. In this paper, we conduct a systematic evaluation of the impact of environmental factors on test flakiness in JavaScript. We first executed test suites across multiple environmental configurations to determine whether changes in the environment could lead to flaky behavior. We selected three environmental factors to manipulate: the operating system, the Node.js version, and the browser. We identified a total of 65 environmental flaky projects, with 28 related to operating system issues, five to Node.js version compatibility, 16 to a combination of operating system and Node.js issues, and 17 related to browser compatibility. To address environmental flakiness, we developed a lightweight mitigation approach, js-env-sanitizer, that can sanitize environmental-related flaky tests by skipping and reporting them (rather than failing), allowing CI builds to continue/succeed without rerunning entire test suites. The tool achieves high accuracy with minimal performance or configuration overhead, and currently supports three popular JavaScript testing frameworks (Jest, Mocha, and Vitest)
format Preprint
id arxiv_https___arxiv_org_abs_2602_19098
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle A Systematic Evaluation of Environmental Flakiness in JavaScript Tests
Hashemi, Negar
Tahir, Amjed
Shi, August
Rasheed, Shawn
Blagojevic, Rachel
Software Engineering
Test flakiness is a significant issue in industry, affecting test efficiency and product quality. While extensive research has examined the impact of flaky tests, many root causes remain unexplored, particularly in the context of dynamic languages such as JavaScript. In this paper, we conduct a systematic evaluation of the impact of environmental factors on test flakiness in JavaScript. We first executed test suites across multiple environmental configurations to determine whether changes in the environment could lead to flaky behavior. We selected three environmental factors to manipulate: the operating system, the Node.js version, and the browser. We identified a total of 65 environmental flaky projects, with 28 related to operating system issues, five to Node.js version compatibility, 16 to a combination of operating system and Node.js issues, and 17 related to browser compatibility. To address environmental flakiness, we developed a lightweight mitigation approach, js-env-sanitizer, that can sanitize environmental-related flaky tests by skipping and reporting them (rather than failing), allowing CI builds to continue/succeed without rerunning entire test suites. The tool achieves high accuracy with minimal performance or configuration overhead, and currently supports three popular JavaScript testing frameworks (Jest, Mocha, and Vitest)
title A Systematic Evaluation of Environmental Flakiness in JavaScript Tests
topic Software Engineering
url https://arxiv.org/abs/2602.19098