From 6f3367ef61af8f8c690717197263b7a92d41d916 Mon Sep 17 00:00:00 2001 From: Michal Dorner Date: Sat, 16 Jan 2021 23:06:50 +0100 Subject: [PATCH] Use normalizeFilePath() to unify test output on windows/Linux --- __tests__/__outputs__/dart-json.md | 2 +- __tests__/__outputs__/dotnet-trx.md | 2 +- __tests__/__outputs__/jest-junit.md | 2 +- __tests__/__snapshots__/dart-json.test.ts.snap | 2 +- __tests__/__snapshots__/dotnet-trx.test.ts.snap | 2 +- __tests__/__snapshots__/jest-junit.test.ts.snap | 2 +- __tests__/dart-json.test.ts | 3 ++- __tests__/dotnet-trx.test.ts | 3 ++- __tests__/jest-junit.test.ts | 3 ++- 9 files changed, 12 insertions(+), 9 deletions(-) diff --git a/__tests__/__outputs__/dart-json.md b/__tests__/__outputs__/dart-json.md index f7e3ec3..26a0df7 100644 --- a/__tests__/__outputs__/dart-json.md +++ b/__tests__/__outputs__/dart-json.md @@ -1,4 +1,4 @@ -### fixtures\dart-json.json +### fixtures/dart-json.json **6** tests were completed in **3.760s** with **1** passed, **1** skipped and **4** failed. diff --git a/__tests__/__outputs__/dotnet-trx.md b/__tests__/__outputs__/dotnet-trx.md index 1e7342d..7a305bf 100644 --- a/__tests__/__outputs__/dotnet-trx.md +++ b/__tests__/__outputs__/dotnet-trx.md @@ -1,4 +1,4 @@ -### fixtures\dotnet-trx.trx +### fixtures/dotnet-trx.trx **7** tests were completed in **1.061s** with **3** passed, **1** skipped and **3** failed. diff --git a/__tests__/__outputs__/jest-junit.md b/__tests__/__outputs__/jest-junit.md index d086fc3..95fef88 100644 --- a/__tests__/__outputs__/jest-junit.md +++ b/__tests__/__outputs__/jest-junit.md @@ -1,4 +1,4 @@ -### fixtures\jest-junit.xml +### fixtures/jest-junit.xml **6** tests were completed in **1.360s** with **1** passed, **1** skipped and **4** failed. diff --git a/__tests__/__snapshots__/dart-json.test.ts.snap b/__tests__/__snapshots__/dart-json.test.ts.snap index 2460bce..bddc0c1 100644 --- a/__tests__/__snapshots__/dart-json.test.ts.snap +++ b/__tests__/__snapshots__/dart-json.test.ts.snap @@ -52,7 +52,7 @@ dart:isolate _RawReceivePortImpl._handleMessage "title": "[test\\\\second_test.dart] Timeout test", }, ], - "summary": "### fixtures\\\\dart-json.json + "summary": "### fixtures/dart-json.json **6** tests were completed in **3.760s** with **1** passed, **1** skipped and **4** failed. diff --git a/__tests__/__snapshots__/dotnet-trx.test.ts.snap b/__tests__/__snapshots__/dotnet-trx.test.ts.snap index 2eb0eea..2440001 100644 --- a/__tests__/__snapshots__/dotnet-trx.test.ts.snap +++ b/__tests__/__snapshots__/dotnet-trx.test.ts.snap @@ -30,7 +30,7 @@ Actual: 2", "title": "[DotnetTests.XUnitTests.CalculatorTests] Failing_Test", }, ], - "summary": "### fixtures\\\\dotnet-trx.trx + "summary": "### fixtures/dotnet-trx.trx **7** tests were completed in **1.061s** with **3** passed, **1** skipped and **3** failed. diff --git a/__tests__/__snapshots__/jest-junit.test.ts.snap b/__tests__/__snapshots__/jest-junit.test.ts.snap index 9bf8aa2..3936f88 100644 --- a/__tests__/__snapshots__/jest-junit.test.ts.snap +++ b/__tests__/__snapshots__/jest-junit.test.ts.snap @@ -73,7 +73,7 @@ Received: false "title": "[__tests__\\\\second.test.js] Timeout test", }, ], - "summary": "### fixtures\\\\jest-junit.xml + "summary": "### fixtures/jest-junit.xml **6** tests were completed in **1.360s** with **1** passed, **1** skipped and **4** failed. diff --git a/__tests__/dart-json.test.ts b/__tests__/dart-json.test.ts index f1d6b4e..09da075 100644 --- a/__tests__/dart-json.test.ts +++ b/__tests__/dart-json.test.ts @@ -3,11 +3,12 @@ import * as path from 'path' import {parseDartJson} from '../src/parsers/dart-json/dart-json-parser' import {ParseOptions} from '../src/parsers/parser-types' +import {normalizeFilePath} from '../src/utils/file-utils' const fixturePath = path.join(__dirname, 'fixtures', 'dart-json.json') const outputPath = path.join(__dirname, '__outputs__', 'dart-json.md') const xmlFixture = { - path: path.relative(__dirname, fixturePath), + path: normalizeFilePath(path.relative(__dirname, fixturePath)), content: fs.readFileSync(fixturePath, {encoding: 'utf8'}) } diff --git a/__tests__/dotnet-trx.test.ts b/__tests__/dotnet-trx.test.ts index 3298f3e..b18075c 100644 --- a/__tests__/dotnet-trx.test.ts +++ b/__tests__/dotnet-trx.test.ts @@ -3,11 +3,12 @@ import * as path from 'path' import {parseDotnetTrx} from '../src/parsers/dotnet-trx/dotnet-trx-parser' import {ParseOptions} from '../src/parsers/parser-types' +import {normalizeFilePath} from '../src/utils/file-utils' const fixturePath = path.join(__dirname, 'fixtures', 'dotnet-trx.trx') const outputPath = path.join(__dirname, '__outputs__', 'dotnet-trx.md') const xmlFixture = { - path: path.relative(__dirname, fixturePath), + path: normalizeFilePath(path.relative(__dirname, fixturePath)), content: fs.readFileSync(fixturePath, {encoding: 'utf8'}) } diff --git a/__tests__/jest-junit.test.ts b/__tests__/jest-junit.test.ts index 816184f..efbc01c 100644 --- a/__tests__/jest-junit.test.ts +++ b/__tests__/jest-junit.test.ts @@ -3,11 +3,12 @@ import * as path from 'path' import {parseJestJunit} from '../src/parsers/jest-junit/jest-junit-parser' import {ParseOptions} from '../src/parsers/parser-types' +import {normalizeFilePath} from '../src/utils/file-utils' const fixturePath = path.join(__dirname, 'fixtures', 'jest-junit.xml') const outputPath = path.join(__dirname, '__outputs__', 'jest-junit.md') const xmlFixture = { - path: path.relative(__dirname, fixturePath), + path: normalizeFilePath(path.relative(__dirname, fixturePath)), content: fs.readFileSync(fixturePath, {encoding: 'utf8'}) }