test: read the fixture basename on either separator

Issue: #247
User-Visible: no
This commit is contained in:
Matysh
2026-08-23 00:19:54 +03:00
parent 005eb7fa1b
commit 0c5683d3bf
2 changed files with 30 additions and 1 deletions
+13
View File
@@ -122,6 +122,19 @@ export const MUTANTS = [
replace: ' const span = centre;',
}],
},
{
id: 'docs-fixture-splits-posix-only',
guard: 'node --test --test-name-pattern="не зависит от разделителя платформы" '
+ 'test/docs-accept.test.mjs',
because: 'фикстура приёмки разбирала путь только по «/» и на Windows отдавала весь путь '
+ 'вместо имени файла: три проверки краснели на верной реализации, а Linux этого не '
+ 'видел вовсе — регресс обязан краснеть на любой платформе (#247)',
patches: [{
file: 'test/docs-accept.test.mjs',
find: "export const basename = (path) => String(path).split(/[\\\\/]/).filter(Boolean).pop() ?? '';",
replace: "export const basename = (path) => String(path).split('/').pop() ?? '';",
}],
},
{
id: 'docs-accept-takes-any-chromium',
guard: 'node --test --test-name-pattern="без названного Chromium" test/docs-accept.test.mjs',