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

seneca-store-test

v6.0.0

Published

Standard test cases for seneca stores

Downloads

7,545

Readme

Seneca

A Seneca.js plugin

seneca-store-test

npm version Build Status Build Dependency Status Coveralls Maintainability DeepScan grade

Description

This module provides a standard set of tests for Seneca data stores.

It is used to verify that a store meets the minimum requirements needed for the Seneca data message patterns. See the Seneca Data Entities article for more information.

This module is included as a development dependency by Seneca data store plugins. For a simple example, see the seneca-mem-store plugin test cases.

If you're using this module, and need help, you can:

seneca-store-test's source can be read in an annotated fashion by,

  • running npm run annotate

The annotated source can be found locally at ./doc/store-test.html.

Install

npm install seneca-store-test

Contributing

The Senecajs org encourage open participation. If you feel you can help in any way, be it with documentation, examples, extra testing, or new features please get in touch.

Before you test

Passing the test for race conditions

Chances are, in order to pass the test for race conditions, you need to create
a unique index on the users.email column/field, - whether you are testing
a plugin meant for a SQL or a NoSQL database/store.

That's due to the way how upserts are normally implemented in databases.

For example, in case of MongoDb, in order for the database to be able to avert
race conditions, a field you upsert on must have a unique index created on it.
Without the index, your upserts will not be atomic, and as a result your plugin
will fail the race condition tests.

It is a case of a leaky abstraction that test suites of client store plugins
must "know" what collection and what field is being used in a race condition
test in seneca-store-test. We may want to come up with a better alternative
in the future.

Test

npm run test

License

Copyright (c) 2013-2018, Richard Rodger and other contributors. Licensed under MIT.