Skip to content

Commit

Permalink
Merge pull request #18 from abhinavminhas/dev
Browse files Browse the repository at this point in the history
Updates
  • Loading branch information
abhinavminhas authored Oct 11, 2022
2 parents c0c5638 + d0c0a74 commit 0ffc107
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@ jobs:
strategy:
matrix:
os: [ ubuntu-20.04, windows-2022, macos-11 ]
node-version: [ 14.x, 16.x, 17.x ]
node-version: [ 14.x, 16.x, 17.x, 18.x ]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test

- name: Upload Artifact
if: ${{ matrix.os == 'ubuntu-20.04' && matrix.node-version == '16.x' }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: qtest-mstest-parser
path: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ jobs:

steps:
- name: Checkout Repository
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Set Up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

Expand All @@ -40,7 +40,7 @@ jobs:
run: nyc --reporter=lcov npm test

- name: Upload Coverage To Codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}

4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ jobs:
node-version: [ 16.x ]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm install
Expand Down
24 changes: 12 additions & 12 deletions tests/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const parser = require('../parser.js');
(async () => {
console.log('TEST 1 - Parse MSTest (TestResults-DifferentTestOutcomes.trx) results file with different test outcomes (using path with filename).');
let result = await parser.parse('./tests/sample-mstest-results/TestResults-DifferentTestOutcomes.trx', null);
var resultString = JSON.stringify(result, null, 4);
let resultString = JSON.stringify(result, null, 4);
//console.log(resultString);
//All records exist comparison.
assert(resultString.includes('"order": 1'));
Expand All @@ -19,7 +19,7 @@ const parser = require('../parser.js');
(async () => {
console.log('TEST 2 - Parse MSTest (TestResults-AllPassedOutcomes.trx) results file with all passed test outcomes (using path with filename).');
let result = await parser.parse('./tests/sample-mstest-results/TestResults-AllPassedOutcomes.trx', null);
var resultString = JSON.stringify(result, null, 4);
let resultString = JSON.stringify(result, null, 4);
//console.log(resultString);
//All records exist comparison.
assert(resultString.includes('"order": 1'));
Expand All @@ -35,7 +35,7 @@ const parser = require('../parser.js');
(async () => {
console.log('TEST 3 - Parse MSTest (TestResults-AllFailedOutcomes.trx) results file with all failed test outcomes (using path with filename).');
let result = await parser.parse('./tests/sample-mstest-results/TestResults-AllFailedOutcomes.trx', null);
var resultString = JSON.stringify(result, null, 4);
let resultString = JSON.stringify(result, null, 4);
//console.log(resultString);
//All records exist comparison.
assert(resultString.includes('"order": 1'));
Expand All @@ -51,7 +51,7 @@ const parser = require('../parser.js');
(async () => {
console.log('TEST 4 - Parse MSTest (TestResults-WithAttachments.trx) results file with attachment details (using path with filename).');
let result = await parser.parse('./tests/sample-mstest-results/TestResults-WithAttachments.trx', null);
var resultString = JSON.stringify(result, null, 4);
let resultString = JSON.stringify(result, null, 4);
//console.log(resultString);
//All records exist comparison.
assert(resultString.includes('"order": 1'));
Expand All @@ -65,7 +65,7 @@ const parser = require('../parser.js');
(async () => {
console.log('TEST 5 - Parse all MSTest (.trx) result files (using path to result files - path ending /).');
let result = await parser.parse('./tests/sample-mstest-results/', null);
var resultString = JSON.stringify(result, null, 4);
let resultString = JSON.stringify(result, null, 4);
//console.log(resultString);
//Record start comparison.
assert(resultString.includes('"order": 1'));
Expand All @@ -78,7 +78,7 @@ const parser = require('../parser.js');
(async () => {
console.log('TEST 6 - Parse all MSTest (.trx) result files (using path to result files - path not ending /).');
let result = await parser.parse('./tests/sample-mstest-results', null);
var resultString = JSON.stringify(result, null, 4);
let resultString = JSON.stringify(result, null, 4);
//console.log(resultString);
//Record start comparison.
assert(resultString.includes('"order": 1'));
Expand All @@ -91,7 +91,7 @@ const parser = require('../parser.js');
(async () => {
console.log('TEST 7 - Parse all MSTest (.trx) result files (using matching pattern - *.trx /).');
let result = await parser.parse('./tests/sample-mstest-results/*.trx', null);
var resultString = JSON.stringify(result, null, 4);
let resultString = JSON.stringify(result, null, 4);
//console.log(resultString);
//Record start comparison.
assert(resultString.includes('"order": 1'));
Expand All @@ -104,7 +104,7 @@ const parser = require('../parser.js');
(async () => {
console.log('TEST 8 - Parse all MSTest (.trx) result files (using matching pattern - **/*.trx /).');
let result = await parser.parse('./tests/sample-mstest-results/**/*.trx', null);
var resultString = JSON.stringify(result, null, 4);
let resultString = JSON.stringify(result, null, 4);
//console.log(resultString);
//Record start comparison.
assert(resultString.includes('"order": 1'));
Expand Down Expand Up @@ -152,7 +152,7 @@ const parser = require('../parser.js');

(async () => {
console.log('TEST 11 - Delay test.');
var waitTime = Math.floor(Math.random() * (4000 - 1000) + 1000);
let waitTime = Math.floor(Math.random() * (4000 - 1000) + 1000);
let timeNow = new Date().getTime();
parser.delay(waitTime);
let timeAfter = new Date().getTime();
Expand All @@ -170,9 +170,9 @@ const parser = require('../parser.js');

(async () => {
console.log('TEST 13 - Parse MSTest (TestResults-DifferentTestOutcomes.trx) results file with different test outcomes (using path with filename) & delay option.');
var waitTime = Math.floor(Math.random() * (4000 - 1000) + 1000);
let waitTime = Math.floor(Math.random() * (4000 - 1000) + 1000);
let result = await parser.parse('./tests/sample-mstest-results/TestResults-DifferentTestOutcomes.trx', { delay: waitTime });
var resultString = JSON.stringify(result, null, 4);
let resultString = JSON.stringify(result, null, 4);
//console.log(resultString);
//All records exist comparison.
assert(resultString.includes('"order": 1'));
Expand All @@ -188,7 +188,7 @@ const parser = require('../parser.js');
console.log('TEST 14 - Parse all MSTest (.trx) result files (using path to result files - path ending /) & delay option.');
let waitTime = Math.floor(Math.random() * (4000 - 1000) + 1000);
let result = await parser.parse('./tests/sample-mstest-results/', { delay: waitTime });
var resultString = JSON.stringify(result, null, 4);
let resultString = JSON.stringify(result, null, 4);
//console.log(resultString);
//Record start comparison.
assert(resultString.includes('"order": 1'));
Expand Down

0 comments on commit 0ffc107

Please sign in to comment.