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": "",

BDD at Unit Level — Counter-Intuitive, Fast, and Surprisingly Easy

Most teams run BDD scenarios as integration tests through the UI or API. It seems logical: Gherkin describes high-level behavior, so run high-level tests.

But what if that assumption costs you 10 minutes or even hours of feedback time, brittle infrastructure, and constant debugging?

I propose an approach that flips the script: BDD at unit level.