This repository has been archived on 2026-03-06. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
openclaw-extensions/wecom/node_modules/signal-polyfill/tests/behaviors/cycles.test.ts
T

17 lines
500 B
TypeScript

import {describe, expect, it} from 'vitest';
import {Signal} from '../../src/wrapper.js';
describe('Cycles', () => {
it('detects trivial cycles', () => {
const c = new Signal.Computed(() => c.get());
expect(() => c.get()).toThrow();
});
it('detects slightly larger cycles', () => {
const c = new Signal.Computed(() => c2.get());
const c2 = new Signal.Computed(() => c.get());
const c3 = new Signal.Computed(() => c2.get());
expect(() => c3.get()).toThrow();
});
});