From 7f10f7a946a4db603796f11963ae6bbc5d087b55 Mon Sep 17 00:00:00 2001 From: Michel Weststrate Date: Tue, 15 Oct 2024 21:43:32 +0200 Subject: [PATCH] chore: add TypeScript test for fow --- .../__tests__/v5/base/typescript-decorators.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/mobx/__tests__/v5/base/typescript-decorators.ts b/packages/mobx/__tests__/v5/base/typescript-decorators.ts index 9e6185dc4..dafbcb360 100644 --- a/packages/mobx/__tests__/v5/base/typescript-decorators.ts +++ b/packages/mobx/__tests__/v5/base/typescript-decorators.ts @@ -22,7 +22,9 @@ import { IAtom, createAtom, runInAction, - makeObservable + makeObservable, + flow, + flowResult } from "../../../src/mobx" import * as mobx from "../../../src/mobx" @@ -61,6 +63,16 @@ test("decorators", () => { constructor() { makeObservable(this) } + + @flow + *testDouble(n: number): Generator { + yield 3 + return n * 2 + } + + async run() { + const x: number = await flowResult(this.testDouble(2)) + } } const o = new Order()