My own super implementation (function sample)

by Arnaud Buchholz

CSS

.message {
  display: inline-block;
  width: 50%;
}

.ok {
   color: green;
}

.ko {
  color: red;
}

JavaScript

function A (value) {
    this._a = true;
    this._value = value || "a";
}

Object.assign(A.prototype, {
    getValue: function () {
        return this._value;
    }
});

function B () {
    A.call(this, "b");
    this._b = true;
}

B.prototype = Object.create(A.prototype);
Object.assign(B.prototype, {
    getValue: function () {
        return A.prototype.getValue.call(this).toUpperCase();
    }
});

function assert (condition, message) {
	var line = document.createElement("div");
  line.className = "assert";
  var messageNode = document.createElement("span");
  messageNode.className = "message";
  messageNode.appendChild(document.createTextNode(message));
  line.appendChild(messageNode);
  var conditionNode = document.createElement("span");
  conditionNode.className = condition ? "ok" : "ko";
  conditionNode.innerHTML = condition ? "✔" : "ko";
  line.appendChild(conditionNode);
  return document.body.appendChild(line);
}

assert("function" === typeof A, "A is a function");
assert("function" === typeof B, "B is a function");
assert("function" === typeof A.prototype.getValue, "A.prototype.getValue is a function");
var b = new B();
assert(3 === Object.keys(b).length, "b has only 3 own properties");
["_a", "_b", "_value"].forEach(function (name) {
	assert(b.hasOwnProperty(name), "b has own property " + name);
});
assert(b instanceof A, "b is an instance of A");