S.sample.spec.js 570 B

1234567891011121314151617181920212223
  1. /* globals describe, it, expect */
  2. describe("S.sample(...)", function () {
  3. it("avoids a depdendency", function () {
  4. S.root(function () {
  5. var a = S.data(1),
  6. b = S.data(2),
  7. c = S.data(3),
  8. d = 0,
  9. e = S(function () { d++; a(); S.sample(b); c(); });
  10. expect(d).toBe(1);
  11. b(4);
  12. expect(d).toBe(1);
  13. a(5);
  14. c(6);
  15. expect(d).toBe(3);
  16. });
  17. })
  18. })