rafa
Version:
Rafa.js is a Javascript framework for building concurrent applications.
27 lines (23 loc) • 678 B
JavaScript
module.exports = (assert, Rafa) => {
suite("constructor", () => {
test("single property", () => {
var p = Rafa.property(1);
assert.isNull(p.properties);
assert.equal(p.value, 1);
});
test("1 dependent", () => {
var a = Rafa.property(1);
var b = Rafa.property(() => a + 1);
assert.equal(a.properties[0], b);
assert.equal(b.value, 2);
});
test("2 dependents", () => {
var a = Rafa.property(1);
var b = Rafa.property(() => a + 1);
var c = Rafa.property(() => a + b);
assert.equal(a.properties[0], b);
assert.equal(a.properties[1], c);
assert.equal(c.value, 3);
});
});
};