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

rotan

v2.0.0

Published

bamboo test utils

Downloads

7

Readme

rotan

npm version Build Status Coverage Status JavaScript Style Guide

Rotan is a small command line utility to easily test your artifacts (in Bamboo :). It can output tap or xunit reports.

Currently you can do the following:

Installation

npm install rotan

Getting help

  • rotan -h
  • rotan openapi -h
  • rotan json -h
  • rotan js -h

Examples

Validate your OpenAPI or Swagger files

tap output:

rotan openapi openapi-definition.json

TAP version 13
# Parse file openapi-definition.json
ok 1 Valid swagger file

1..1
# tests 1
# pass  1

# ok

xunit reporting:

rotan openapi openapi-definition.json -x

<?xml version="1.0"?>
<testsuites>
  <testsuite name="Parse file use-rotan-swagger.json" tests="1" failures="0" errors="0">
    <testcase name="#1 Valid swagger file"/>
  </testsuite>
</testsuites>

Validate a JSON/YAML file with a JSON schema

rotan json schema.json swagger.json

TAP version 13
# Structure of input file should conform to the schema
ok 1 swagger.json is valid
ok 2 schema.json is valid JSON
ok 3 swagger.json is conform schema.json

1..3
# tests 3
# pass  3

# ok
rotan json schema.json swagger.json -x

<?xml version="1.0"?>
<testsuites>
  <testsuite name="Structure of iput file should conform to the schema" tests="3" failures="0" errors="0">
    <testcase name="#1 swagger.json is valid"/>
    <testcase name="#2 schema.json is valid JSON"/>
    <testcase name="#3 swagger.json is conform schema.json"/>
  </testsuite>
</testsuites>
# inject snippets into your openapi before validating
rotan json schema.json swagger.yaml -i 'snippets/*.yaml'
TAP version 13
# Structure of input file should conform to the schema
ok 1 swagger.yaml is valid
ok 2 schema.json is valid JSON
ok 3 swagger.yaml is conform schema.json

1..3
# tests 3
# pass  3

# ok

Custom tape test

Create your tape tests like this:

// tests.js
exports.test = function (options) {
  var test = options.tape.createHarness()
  var stream = test.createStream()

  test('it should return ok', function (t) {
    t.plan(1)
    t.ok(true, 'looking good')
  })

  return stream
}

Then run it like this:

rotan js tests.js

TAP version 13
# it should return ok
ok 1 looking good

1..1
# tests 1
# pass  1

# ok

or

rotan js tests.js -x

<?xml version="1.0"?>
<testsuites>
  <testsuite name="it should return ok" tests="1" failures="0" errors="0">
    <testcase name="#1 looking good"/>
  </testsuite>
</testsuites>