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

doughnut

v0.0.3

Published

Makes end-to-end testing with mocha and meteor easy.

Downloads

5

Readme

Doughnut

Makes end-to-end testing with mocha and meteor easy.

Installation

If you are only using the command line utility it will probably be easier to install the package globally.

npm i -g doughnut

What it does

This package is very simple but helpful when it comes to end-to-end testing. The process is as follows:

  1. Create a new mongodb instance. (Default mongo port: 45786)
  2. Create a new meteor instance set to use the new mongodb. (Default meteor port: 45787)
  3. Start mocha.(Default test folder with CLI: cwd/tests)
  4. If a mocha test fails exit with an error. Otherwise exit without.
  5. Drop the mongodb collections and shutdown the mongodb instance.
  6. Shutdown Meteor.

So really it's a little bit of automation that sets you up to write end-to-end tests the way most people are used too. Just take your favorite assertion library and your favorite headless browser and go to town.

CLI usage

Most developers will probably only need the CLI tool. After installing you can just run the "doughnut" or "donut" command. They both direct to the same script. I included both to avoid confusion with the multiple spellings of doughnut.

Options:
--mongoport         Set a different port to be used for mongodb.
--meteorport        Set a different port to be used for meteor.
--data              Set a custom mongodb data directory.
--meteortimeout     Set the timeout for the meteor start up process.
-h, --help          Show help
-t, --mochatimeout  Sets the timeout for each mocha test.
-r, --reporter      Set the mocha reporter.
-u, --ui            Set the mocha ui.
-d, --test          Set a custom directory for your test files.
-p, --project       Set a custom directory for your meteor project
-v, --verbose       Sets the logging to include more then just the reporter.

Using doughnut programmatically

Using doughnut programmatically may be useful if you need additional automation. It is set up rather simply for you to use.

const doughnut = require("doughnut");
doughnut([doughnut options][, mocha options][, callback])

The doughnut and mocha options are both objects. All of the parameters are optional. There are sensible defaults if you choose to use none. If you decide to not include a callback then doughnut will return a promise for you.

Doughnut options:
{
    mongoPort: Number (Default: 45786),
    meteorPort: Number (Default: 45787),
    dataDir: String (Default: <doughnuts directory>/data)
    testDir: String (Default: <your app directory>/tests),
    projectDir: String (Default: <your app directory>),
    verbose: opts.verbose (Default: false),
    timeout: Number (Default: 60000) // This is in milliseconds
}

The timeout is for how long doughnut gives mongo and meteor to start up. It has nothing to do with mochas timeout.

Mocha options:

Using mocha programmatically.

I only pass the mocha options directly to the mocha object. So any setting covered in the above article should apply to doughnut.

About us.

Don’t Panic solves complicated business issues through collaborative and innovative coaching techniques, augmented with custom technology solutions.

If you have a use for any of our services you can contact us at [email protected]