import {expect, test} from 'vitest'; import {first} from '@/swcx/builders.js'; import evaluate from '@/swcx/evaluate.js'; test('evaluates await expressions', async () => { const evaluated = evaluate(await first('await 1')); expect(evaluated.async) .to.equal(true); expect(await evaluated.value) .to.equal(1); }); test('coalesces promises', async () => { const evaluated = evaluate(await first('await await await 1')); expect(evaluated.async) .to.equal(true); expect(await evaluated.value) .to.equal(1); });