Windows and Git Bash testing compatibility guide for Vitest, Playwright, and MSW with path conversion patterns
View on GitHubJosiahSiegel/claude-plugin-marketplace
test-master
plugins/test-master/skills/windows-git-bash-testing/SKILL.md
January 20, 2026
Select agents to install to:
npx add-skill https://github.com/JosiahSiegel/claude-plugin-marketplace/blob/main/plugins/test-master/skills/windows-git-bash-testing/SKILL.md -a claude-code --skill windows-git-bash-testingInstallation paths:
.claude/skills/windows-git-bash-testing/# Windows and Git Bash Testing Compatibility Guide
## Overview
This guide provides essential knowledge for running Vitest, Playwright, and MSW tests on Windows, particularly in Git Bash/MINGW environments. It addresses common path conversion issues, shell detection, and cross-platform test execution patterns.
## Shell Detection in Test Environments
### Detecting Git Bash/MINGW
When running tests in Git Bash or MINGW environments, use these detection methods:
**Method 1: Environment Variable (Most Reliable)**
```javascript
// Detect Git Bash/MINGW in Node.js test setup
function isGitBash() {
return !!(process.env.MSYSTEM); // MINGW64, MINGW32, MSYS
}
function isWindows() {
return process.platform === 'win32';
}
function needsPathConversion() {
return isWindows() && isGitBash();
}
```
**Method 2: Using uname in Setup Scripts**
```bash
# In bash test setup scripts
case "$(uname -s)" in
MINGW64*|MINGW32*|MSYS_NT*)
# Git Bash/MINGW environment
export TEST_ENV="mingw"
;;
CYGWIN*)
# Cygwin environment
export TEST_ENV="cygwin"
;;
Linux*)
export TEST_ENV="linux"
;;
Darwin*)
export TEST_ENV="macos"
;;
esac
```
**Method 3: Combined Detection for Test Configuration**
```javascript
// vitest.config.js or test setup
import { execSync } from 'child_process';
function detectShell() {
// Check MSYSTEM first (most reliable for Git Bash)
if (process.env.MSYSTEM) {
return { type: 'mingw', subsystem: process.env.MSYSTEM };
}
// Try uname if available
try {
const uname = execSync('uname -s', { encoding: 'utf8' }).trim();
if (uname.startsWith('MINGW')) return { type: 'mingw' };
if (uname.startsWith('CYGWIN')) return { type: 'cygwin' };
if (uname === 'Darwin') return { type: 'macos' };
if (uname === 'Linux') return { type: 'linux' };
} catch {
// uname not available (likely Windows cmd/PowerShell)
}
return { type: 'unknown', platform: process.platform };
}
const shell = detectShe