Skip to content

Instantly share code, notes, and snippets.

View alexschwartz's full-sized avatar

Alex Schwartz alexschwartz

View GitHub Profile
@alexschwartz
alexschwartz / spec.js
Last active January 13, 2020 21:11
node.js: parse xunit test file
var expect = require("chai").expect;
var walk_tests = require("./walk_xunit_tests.js").walk_tests;
var util = require('util');
describe("walk_tests", function() {
let input = `<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite name="SuiteA" errors="0" skipped="1" tests="3" failures="1">
<testcase classname="Class A" name="test1" time="0.006" status="run"/>
{
"LABEL": {
"name": "PR title needs jira ticket",
"color": "CC00CC"
},
"CHECKS": {
"alwaysPassCI": false,
"prefixes": [ "Bump " ],
"regexp": "\\[[A-Z]{2,}-\\d+(,\\s*[A-Z]{2,}-\\d+)*\\]",
"regexpFlags": "",