Mirror: 🎩 A tiny but capable push & pull stream library for TypeScript and Flow
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #20 from kitten/test/basic-toPromise-tests

Add basic tests cases for toPromise.

authored by

Parker Ziegler and committed by
GitHub
1552869f e5148590

+21
+21
__tests__/wonka_test.re
··· 1945 1945 expect(signals) == [|Push(1), Push(3), Push(5), End|]; 1946 1946 }); 1947 1947 }); 1948 + 1949 + describe("toPromise", () => { 1950 + open Expect; 1951 + open! Expect.Operators; 1952 + 1953 + testPromise("should convert a source to a Promise", () => { 1954 + let a = Wonka.fromValue(1); 1955 + 1956 + a 1957 + |> WonkaJs.toPromise 1958 + |> Js.Promise.then_(x => expect(x) |> toEqual(1) |> Js.Promise.resolve); 1959 + }); 1960 + 1961 + testPromise("should resolve only the last emitted value from a source", () => { 1962 + let a = Wonka.fromList([1, 2, 3]); 1963 + 1964 + a 1965 + |> WonkaJs.toPromise 1966 + |> Js.Promise.then_(x => expect(x) |> toEqual(3) |> Js.Promise.resolve); 1967 + }); 1968 + }); 1948 1969 });