UNPKG

redioactive

Version:

Reactive streams for chaining overlapping promises.

25 lines (24 loc) 986 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const redio_1 = __importDefault(require("../redio")); describe('Compact the stream to truthy values only', () => { test('Compacts the example stream', async () => { await expect((0, redio_1.default)([1, null, 2, undefined, 0, '', 3]).compact().toArray()).resolves.toEqual([ 1, 2, 3 ]); }); test('Compacts an empty stream', async () => { await expect((0, redio_1.default)([]).compact().toArray()).resolves.toEqual([]); }); test('Does not compact a truthy stream', async () => { await expect((0, redio_1.default)(['This', 'should', 'work', 2]).compact().toArray()).resolves.toEqual([ 'This', 'should', 'work', 2 ]); }); });