Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@cds-au/testdocs-cli

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cds-au/testdocs-cli

Tools for managing the presentation of test case documentation for the Australian Consumer Data Right regime

  • 0.0.8
  • unpublished
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Consumer Data Right Testing CLI

Overview

The testdocs-cli can be used to validate and render test case documentation documented in JSON that is compliant with the CDR test documentation JSON schema.

This tool has been created by the Data Standards Body to support participants implementing of the technical standards developed for the Australian Consumer Data Right regime.

The goal of the testdocs-cli the corresonding testdocs library is to provide tooling for the documentation of tests so that CDR participants can test their implementations with confidence that they are conformant with the standards.

CLI Usage

To install the testdocs command line tool (testdocs-cli) you need to have npm installed. With npm installed run the following command: npm install @cds-au/testdocs-cli -g

This will make the CLI available globally.

Documentation Schema Command

Command

doc-schema Print out the testdocs schema currently in use to stdout. This will be the full JSON schema file and allows for the schema to be reused in your own tools or workflow.

Arguments

None

Options
OptionsDescription
--versionOutput only the version of the schema that the CLI is currently using
Examples

testdocs-cli doc-schema Output the current test doc schema to stdout

testdocs-cli doc-schema --version Output the version of test doc schema to stdout

Validate Documentation Command

Command

validate <filename> Validate that the JSON file specified is a valid JSON file and also fully compliant with the current test documentation schema. Errors will be published to stderr and a non-zero response will be provided.

Arguments
ArgumentDescription
<filename>The path to the file (expected to be a valid JSON file) to be validated.
Options

None

Examples

testdocs-cli validate doc.json Validate doc.json and output any validation errors to stderr

Generate Output Command

Command

generate <type> <src> <dst> Read in the specified source and generate output according to the type specified. Can be used to generate human readable versions of the test documentation data in various formats.

Arguments
ArgumentDescription
<type>The type of the output to generate. Can be json, html or markdown. Note that the json mode converts a series of CSV files exported from Excel into JSON and is temporary until an editor capability is available.
<src>The source file or path to read in and generate the output from. For html and markdown the <src> is expected to be a single JSON file containing test documentation compliant with the current schema. For json the <src> is expected to be a path containing a series of CSV files that represent an export of the the test documentation from an Excel workbook.
<dst>The destination file for the generated output. The type will align to the type specified in the <type> argument.
Options

None

Examples

testdocs-cli generate json ./csvfiles/ ./doc.json Convert a folder structure containing a series of CSV files each containing different aspects of the test documentation into a single JSON file containing test documentation aligned to the test doc schema. Note that schema compliance for the output is dependent on the validity of the data in the CSV files.

testdocs-cli generate html ./doc.json ./doc.html Convert the documentation in doc.json into standalone HTML and output to doc.html. All CSS and JS will be inline in the resulting HTML file.

testdocs-cli generate markdown ./doc.json ./doc.md Convert the documentation in doc.json into Markdown and output to doc.md. Note that some HTML statements will be included in the markdown so a markdown renderer that supports inline HTML is expected to be used to view the resulting output.

Maintenance

Enhancement and bug fix pull requests are welcome in accordance with the contribution policy for the repository.

For additional contribution please ensure that pull requests are fully tested and include updates to documentation.

Building and Publishing

To build the repository run the following scripts from a bash compliant command prompt or terminal window:

  1. Install libraries npm install
  2. Copy the latetst test documentation schema and build classes npm run sync-schema
  3. Build npm run build

To publish the repository to npm (needs permission) npm publish --access public

Outstanding Features

The following are a list of features that are intended but yet to be added to this capability (contributions welcome):

  • Standalone browser based editor for modifying schema compliant Documentation
  • Addition of test data generation (possibly a separate CLI)
  • Refactor so that the core libraries are in a separate module for reuse
  • Add additional options to output generation to allow for insertion of additional content (eg. CSS, JS)
  • Unit testing to support contributions

FAQs

Package last updated on 25 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc