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 🙏

© 2025 – Pkg Stats / Ryan Hefner

jasmine-dom

v1.0.0

Published

Run your jasmine html SpecRunner in node.js.

Readme

node-jasmine-dom

Run your browser-based jasmine specs headless with node.js. Then output in one of many formats such as JSON or JUnit XML (perfect for integration with CI servers like Jenkins).

installation

npm install -g jasmine-dom

usage

Construct your SpecRunner.html as shown in the jasmine examples, then run:

jasmine-dom --runner path/to/SpecRunner.html

or

jasmine-dom --config path/to/config.yaml

You can optionally provide the following arguments:

  • --help, provides usage information
  • --format simple|detailed|nice|json|html|junit, displays the result in the specified format
  • --output path, writes the output to the specified file
  • --server [port], serves a simple (but effective) page showing the current state of the tests. You can also specify an optional --refresh intervalInMS argument to specify the wait between running the tests (because the server is constantly running 'em).
  • --routeconsole, calls to window.console.log (or error, warn, info) within the tests / tested code will be displayed in the terminal output

server

jasmine-dom --runner examples/runner.html --server 8090 --refresh 3000

will run a server on http://localhost:8090/. Here a simple green or red page will reflect the current state of your tests. The tests will run every 3000ms, and the page ajaximatically updates with the result.

If you'd like to see the default jasmine html, visit http://localhost:8090/jasmine. Note, the result is still obtained via the nodejs runner (i.e. it wasn't run in your browser).

specifying runners

A single runner file can be provided via the --runner <path_to_runner> command. To specify more than one runner, use the --config <path_to_config> argument and a yaml config file in the format:

---
  test_one:
    name: This is the name of the first set of tests
    runner: path/to/runner_1.html
  test_two:
    name: This is the name of the second set of tests
    runner: path/to/another/runner.html

The config file allows you to provide names for your runners. These names will be used when identifying failing tests.

example 1

jasmine-dom --runner examples/runner.html

will output:

Failed.

example 2

jasmine-dom --runner examples/runner.html --format junit --output javascript_results.xml

will write to javascript_results.xml:

<testsuite>
    <testcase classname="/Users/andrew/development/node-jasmine-dom/examples/runner.html.Example_functions_that_update_the_DOM.Should_add_two_numbers" name="expect toEqual 7" time="undefined"/>
    <testcase classname="/Users/andrew/development/node-jasmine-dom/examples/runner.html.Example_functions.Should_multiply_two_numbers" name="expect toEqual 40" time="undefined"/>
    <testcase classname="/Users/andrew/development/node-jasmine-dom/examples/runner.html.Example_functions.Should_fail!!" name="expect toEqual 8">
        <failure>
            <![CDATA[
                FAILURE in spec "Should fail!!": Expected 3 to equal 8.
                Error: Expected 3 to equal 8.
                    at new <anonymous> (/Users/andrew/development/node-jasmine-dom/examples/tests/lib/jasmine.js:94:50)
                    at [object Object].toEqual (/Users/andrew/development/node-jasmine-dom/examples/tests/lib/jasmine.js:1138:29)
                    at [object Object].<anonymous> (/Users/andrew/development/node-jasmine-dom/examples/tests/spec/example-functions_spec.js:10:13)
                    at [object Object].execute (/Users/andrew/development/node-jasmine-dom/examples/tests/lib/jasmine.js:968:15)
                    at [object Object].next_ (/Users/andrew/development/node-jasmine-dom/examples/tests/lib/jasmine.js:1739:31)
                    at [object Object].start (/Users/andrew/development/node-jasmine-dom/examples/tests/lib/jasmine.js:1692:8)
                    at [object Object].execute (/Users/andrew/development/node-jasmine-dom/examples/tests/lib/jasmine.js:2018:14)
                    at [object Object].next_ (/Users/andrew/development/node-jasmine-dom/examples/tests/lib/jasmine.js:1739:31)
                    at [object Object].start (/Users/andrew/development/node-jasmine-dom/examples/tests/lib/jasmine.js:1692:8)
                    at [object Object].execute (/Users/andrew/development/node-jasmine-dom/examples/tests/lib/jasmine.js:2163:14)
            ]]>
        </failure>
    </testcase>
</testsuite>

example 3

jasmine-dom --config ./examples/config.yaml --format nice

with ./examples/config.yaml:

---
  test_one:
    name: Example test one
    runner: ./runner.html
  test_two:
    name: Example test two
    runner: ./runner2.html

will output:

====== FAILED ======
 - In A suite that fails >> Example functions (should fail) >> Should fail!! :: Expected 3 to equal 8.

example 4

jasmine-dom --config ./examples/config.yaml --format detailed

will output:

====== FAILED ======

Example functions (should fail) - 2 tests
  PASSES
    - Should multiply two numbers
  FAILURES
    - Should fail!!
        [Expected 3 to equal 8.]
Example functions that update the DOM - 2 tests
  PASSES
    - Should add two numbers
    - Should divide two numbers
  FAILURES
    (none)

====== FAILED ======

changelog

0.3.0 - 22-12-2012 - Added 'detailed' report format. Made examples a bit clearer.

have you seen jasmine-node?

It's provided a lot of inspiration for this project, and may be just what you're looking for. If you're not reliant on a DOM, then it's worth checking out.