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

vdr-test

v0.1.0

Published

CLI tool used for testing Cloud Elements VDRs using Cucumber

Downloads

4

Readme

Cloud Elements VDR testing tool

NPM Version NPM Downloads

This is a Node.js based CLI tool for doing BDD testing of Cloud Elements Virtual Data Resources (AKA VDRs) using Cucumber.

Installation

First, if you haven't already, install Node.js.

You should install this package globally:

npm install -g vdr-test

You will also need to install The Doctor.

What it does

Usage: vdr-test [options] <account> [<GLOB|DIR|FILE[:LINE]>]

CLI tool used for testing Cloud Elements VDRs using Cucumber

Options:
  -V, --version     output the version number
  -s, --skip-setup  run the tests against the current setup
  -h, --help        output usage information

The only required parameter is account. This represents a login on Cloud Elements as registered in The Doctor.

You may also optionally specify the tests to run. These can be provided in a number of ways:

  • As a glob pattern
    • tests/**/*.feature
  • As a directory
    • tests/dir
  • As a file
    • tests/my_feature.feature
  • As a scenario by its line number in a file
    • tests/my_feature.feature:3

If no tests are given, then it will run all of the tests in the tests directory.

By default, when you run vdr-test, it will:

  1. Upsert a fresh copy of a mock element used for testing (called Stubby)
  2. Delete any instances of the mock element from prior tests
  3. Create an instance of the mock element for each element that you've referenced in any of the tests being run
  4. Upload any of your VDRs (which must be placed in a directory called vdrs in the doctor's directory storage format) which are referenced in the tests being run
  5. Associate any transformations referenced to the mock instance
  6. Execute all of the cucumber tests specified (or all of the tests in tests if none given)

By running all of this vdr-test ensures that the latest versions of your VDRs stored on your computer are tested.

However, steps 1-5 can take a long time. In order to speed up tests, you can provide the --skip-setup (or -s) option, which will skip steps 1-5 and just execute the tests. This is particularly useful when writing new tests.

Writing tests

Tests are written in the Cucumber test language known as gherkin. An example is shown below:

Feature: Support retrieval of SAP B1 information to allow a user to configure location, price list, and tax mappings

  Scenario: Basic ErpPriceList test
    When I POST to the "pricelist" resource of the "sapbusinessone" element with the following YAML payload
      """
      PriceListNo: "1"
      PriceListName: Base Price
      Active: tYES
      """
    Then a GET all from the "ErpPriceList" resource of the "sapbusinessone" element should include the following YAML payload
      """
      id: "1"
      name: Base Price
      active: true
      """

These are currently the only available step definitions. The first parameter (in quotes) is a valid object name and the second one is a valid element key. The text between the """ is the payload expressed as YAML.