npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@teamteanpm2024/earum-quos-illum

v1.1.5

Published

A zero-animal-cruelty JavaScript testing library for async components, observable states and view-models. Based on rx-marbles, it dramatically simplifies setting up unit tests for observable streams.

Downloads

19

Maintainers

shivamkalsi2024shivamkalsi2024

Keywords

call-boundserializationsettingsramdacss nestingesECMAScript 2022nodejsratelimitjapaneseECMAScript 2016setterStyleSheetpathString.prototype.trimmetadatavariables in csscolorbufferlookcssES2015256circularmonorepoiteratorsanitizationuuidautoscalingvpcpackage managerrapidfilterviewreducertesterinternaljsxrandomes6ArrayBuffer.prototype.sliceguidgdprRxdebugArraybluebirdfantasy-landES2022eslintpluginminimalredux-toolkitgetintrinsicmobileESnextconcat0qsexpressionerroroutputtrimRighti18nschemecjkstylingmodulessyntaxObservabledateTypeScriptInt8Arrayparentiterationemojicontainsmochadirectorya11ywriteextracharacterInt32ArrayfindLastairbnbRxJSworkspace:*ES2018ec2io-tsECMAScript 2023classnameslotcensorinferencebcrypttoolkitES8mergedragprogressrdslesscssisConcatSpreadableECMAScript 2015runtimesomelimitjasminepropertytypedwarningObject.entriesstringspringsliceframerRFC-6455shimes8matchformattingAsyncIteratorentriesdefinePropertyischannelwafmkdirFunction.prototype.nameprefixbuffersRegExp.prototype.flagsparseproxyponyfillpersistentfunctionchailoadbalancingargparseforEachiteratees-abstractCSSStyleDeclarationrobustrfc4122workflowstarterbrowserslistnamesyupgetoptfshookscollection.es6ES2020flattenelbprivate datadescriptorsestypeerrorescapespinnersECMAScript 7exitexecemittoSortedtelephone6to5popmotionserializerstreams2less cssfastcopyformmimesymbolcurriednpm$.extendlazyArray.prototype.flatlanguagesequencereact-testing-libraryirqthreeloadingstreamscodesamazoneventDispatcherstructuredCloneargumentcolumnsdotenvresolvefastcloneastconsumebrowserdependency managergenericsdeletewhatwgdefineebsTypeBoxdescriptorsECMAScript 6breakReactiveExtensionsansiownbyteLengthjest.envFloat32Arraycloudsearchintrinsictc39bddcommand-lineecmascriptes5reusestyleguidereducexhrpackagesSymbol.toStringTagcurlparserassertionfast-deep-copyclass-validatorcloudformationajaxlinewrapuprateArrayBuffer#slicewalkinglibphonenumberelectronrm -frformatObservablesrm -rfclassnameskeystakefast-cloneefficientiamreal-timewhichsimpledbcreateanimationinvariantutil.inspectbootstrap cssreact-hook-formsearchcallbacktraverseJSON-Schemaflagsreact-hooksvariableseslintstreamserializevalidmapreduceObject.fromEntriesmkdirpcolorsuser-streamsremoveomitgradients css3recursiveprivatecrypttypedarraysUint8ClampedArrayhelpersconfigurablestylesnested csstimereact posedatastructureiereadthrottleES7phonees7negativeeslint-pluginelasticachebootstrap lessconnectschematypesafeassertscompareMicrosoftextendtypedarrayestreeswftrimflagmulti-packagel10nweakmaphigher-ordertoArraymruwatcherwrapInt16ArrayarrayECMAScript 5quotecryptoObject.keyslesswordbreaknopecore-jsflatharmonytoStringTagregexpfromtranspileajvenvgroupchromelintdataopenwordwrapsymlinktestingsymlinksgetternodeinstallerthroatautoprefixerwatchpluginsigintmacosECMAScript 2019optimizerString.prototype.matchAllUint8ArrayES2019mixinsrangeerrorsetImmediatetostringtagcorstextrgblasttouchWebSocketduplexeventEmittercloudwatchtestrmdirhasOwnProperty3dclassesYAMLutilcharactersredactshrinkwrapfull-widthfoldertypeless.jsconstbusyrmmomentpropfetcharraybufferaccessibilitycorereduxnumberlengthtyped arraymoveparentsfinddeepcopyregexexpresscollectionfile systempnpm9Object.assignsanitizesortedECMAScript 2020kinesistslibObject.getPrototypeOflrutapes2017postcss-pluginvalidatorPushstableassignpatchoperating-systemnameES6koreaneventsfigletoffsetbannercallloggerMapextensiontoobjecttypespreserve-symlinksauthshamsuperstructmime-dbscheme-validationcommanderwindows__proto__command@@toStringTagnegative zeroArray.prototype.flattenprotocol-bufferses-shim APIless mixinsStreamcloudtrailoncecolumntypeofinputURLjwtpositiveArray.prototype.includesBigUint64ArraymatchAllfseventsObject.islinkagentreadablestreamES2016nativetypescriptpackage.jsontypanionwatchFileequals3utilstermbabel-coredeep-copycallbindawsfastbabelECMAScript 2021dom-testing-libraryfindupSymbolpicomatchsyntaxerrorsigtermprocessoptionendpointgesturesfullwidthtapelinuxjoibeanstalkdomES3speedArrayBufferstoragegatewayinterruptsdescriptioncopybalancedargsrequestwritablesymbolsjsdombyteOffsetsharedarraybufferfixed-widthpreprocessorCSSmodulehandlersgradients cssdataviewjson-schema-validatorspectrimLeftsnswaapicliTypedArrayeast-asian-widthcallboundasyncfilePromiseartinternal slotArray.prototype.containsstatusxterm

Readme

LeapingBunny.js

A zero-animal-cruelty JavaScript testing library for async components, observable states and view-models. Based on rx-marbles, it dramatically simplifies setting up unit tests for observable streams.

Leaping Bunny

Motivation

People don't like writing tests... unless it's efficient and fun. If it's not fun, the result is awful and clients are unhappy. If it's not efficient but people have fun writing them, it's a business tragedy. This is especially true when complex UI and async interaction is involved, where each single unit test can get notoriously long to write and maintain.

Leaping Bunny is designed to help testing Rimmel.js components, views and view-models where complex or async logic is involved.

Testing observable states / view-models

View-models in Rimmel.js are often plain in-out Observables (Rx Subjects, BehaviorSubjects, etc), which are best tested using with ASCII-art and Rx Marbles.

This is how easy becomes to test a component's view-model, where you click a button and it counts your clicks.

import { observe } from '@teamteanpm2024/earum-quos-illum';
import viewModel from './view-model.js';

const mappings = {
  input: {
    C: { type: 'click' }, // Map "C" to a DOM "ClickEvent", which will be fed into the view-model
  },
  output: {
  }
};

describe('Click Counter', () => {
  describe('When the button is clicked', () => {

    observe.it('Emit a count of clicks', viewModel, mappings, {
      input:  '---C---C--CC---C---', // Actions (C = button is clicked)
      output: '---1---2--34---5---', // Expectations (1, 2, 3 is the output emitted each time)
    });

  });
});

Testing more complex state / view-models

If your state combines multiple input and/or emits multiple output streams, the easiest way is to wrap your view-model in the Rimmel.js view-model format:

  const multiStreaamViewModel = ([inputs, outputs]) => {
    const { input1, input2 } = inputs;
    const { output1, output2 } = outputs;

    // Business logic goes here.
    // Process input1 and input2, emit output1, output2
  }

This way your view-models can have an unlimited number of input and output streams, and are ready to be testen in very simple way. For instance, take a hypothetical view-model for a UI with two buttons you have to click, alternatively, 5 times each. If you do, you'll get a "You win" message in output, otherwise a "You lose".

// multi-stream-view-model.test.js
import { observe } from '@teamteanpm2024/earum-quos-illum';
import multiStreamViewModel from './multi-stream-view-model.js';

const mappings = {
  input: {
    C: { type: 'click' }, // Map "C" to a DOM "ClickEvent", which will be fed into the view-model
  },
  output: {
    W: 'You win',  // Map "W" to a mnemonic for "You win"
    L: 'You lose', // Map "L" to a mnemonic for "You lose"
  }
};

describe('Alternate clicks', () => {
  describe('When the buttons are clicked 10 times, alternatively', () => {

    observe.it('Emit a "You win" message', viewModel, mappings, {
      inputs: {
        input1: '---C---C--C--C---C-----', // Actions (C = button is clicked)
        input2: '-----C---C--C--C---C---', // Actions (C = button is clicked)
      },
      outputs: {
        output1: '------------------W---', // Expectations. W when the last button is clicked.
      }
    });

  });
});

In the test above we're making sure that when input1 and input2 receive exacly 5 clicks, alternatively, then output1 emits "You win". Want to test if you start with the second button instead? Trivial.

    observe.it('Second button first, then emit a "You win" message', viewModel, mappings, {
      inputs: {
        input1: '-----C---C--C-C----C-', // Actions (C = button is clicked)
        input2: '-C-----C--C--C---C---', // Actions (C = button is clicked)
      },
      outputs: {
        output1: '------------------W-', // Expectations. W when the last button is clicked.
      }
    });

So, what about other cases, when the alternative sequence is not respected?

    observe.it('Second button first, then emit a "You win" message', viewModel, mappings, {
      inputs: {
        input1: '--C--C------C-C----C-', // Actions (C = button is clicked)
        input2: '-C-----CCCC--C---C---', // Actions (C = button is clicked)
      },
      outputs: {
        output1: '----L---------------', // Expectations. L when the first wrong button is clicked.
      }
    });

In this case, we expect output1 to notify as soon as the first wrong button is clicked.