@aspecto/cli
Aspecto CLI
Last updated 2 months ago by nirsky .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @aspecto/cli 
SYNC missed versions from official npm registry.

Don't break your APIs

PRs Welcome Aspecto@npm



What is Aspecto?

Aspecto is the CLI test runner of Aspecto.
You can integrate it in your CI, git hooks or just run it manually.
The CLI will generate a test suite from Aspecto server, based on real data that was collected and prepared beforehand.
The generated suite will be run against a url you will provide, could be localhost, staging, production or anything else.

Installation

In your project, run:

yarn add @aspecto/cli --dev

You can now run aspecto-cli from your package.json scrips, like this:

...
scripts: {
    "aspecto:test": "aspecto test <url> [options]"
}
...

Alternatively, you can install @aspecto/cli globally and use it from the terminal from wherever you'd like.

Usage

aspecto test <URL> [options]

URL

The url you'd like Aspecto CLI to run the generated tests against.
Usually, you'd point this on your localhost when testing locally or to your staging url when running on your CI.

CLI Options

--package <packageName>

Alias -p. This will tell our servers to generate the tests based on which data that was collected beforehand.
It will usually be the name in your service package.json.
If you don't provide this option, we will try to get the name from the package.json ourselves.

--token <token>

Alias -t. Your authentication token, provided at https://app.aspecto.io/app/integration.
If non provided, we'll try to get it ourselves from the ASPECTO_TOKEN env param (process.env.ASPECTO_TOKEN).

--env <envs>

Alias -e. A csv of envs.
This will tell our servers to generate the tests based on data collected in the provided environments.
By default, we will create tests based on data from all environments.

Example: --env production,staging

--allow-methods <methods>

Alias -m. A csv of http methods. This will tell our servers to generate the tests based on data collected from routes meeting the allowed methods.
By default, we will create tests based on all http methods.

Example: --allow-methods POST,PUT

--allow-codes <codes>

Alias -c. A csv of http status codes. This will tell our servers to generate the tests based on data collected from responses with status code meeting the allowed codes.
By default, we will create tests based on all status codes.

Example: --allow-codes 200,204

--allow-fail

Alias -a. Use this flag to make the process quit with 1 when failing.
By default, the process will quit with 0.

--fail-strategy <soft|strict>

Alias -f. Relevant only when using --allow-fail.
Soft will fail the process only on a failed test.
Strict will fail the process on any kind of failure (i.e. bad usage, failure to fetch tests).

--timeout <timeout>

Alias -o. How long to wait (in milliseconds) before timing out an API call as part of the test suites. Default is 5000ms.

--test-param <param>

Alias -r. Supply parameters to populate data in tests which were configured accordingly in Aspecto tests section.
This enables you to alter certain parts of the request to match your specific testing setup.

You can define the parameter and it's value:

--test-param KEY1=value1 --test-param KEY2=value2

If not provided, we will try to pick it from your environment.

--verbose

Alias -v. Use this flag to print debug logs.

Examples

  $ aspecto test http://localhost:3322 --package my-service --token **** --allow-fail --env development -c 200,404 -m GET
  $ aspecto test https://staging.aspecto.com --env staging -a --verbose
  $ aspecto test https://prod.aspecto.com --allow-codes 200,204,500

Current Tags

  • 0.1.18                                ...           latest (2 months ago)

42 Versions

  • 0.1.18                                ...           2 months ago
  • 0.1.17                                ...           2 months ago
  • 0.1.16                                ...           2 months ago
  • 0.1.15                                ...           2 months ago
  • 0.1.14                                ...           2 months ago
  • 0.1.13                                ...           2 months ago
  • 0.1.12                                ...           2 months ago
  • 0.1.11                                ...           2 months ago
  • 0.1.10                                ...           2 months ago
  • 0.1.8                                ...           2 months ago
  • 0.1.6                                ...           2 months ago
  • 0.1.5                                ...           2 months ago
  • 0.1.4                                ...           2 months ago
  • 0.1.3                                ...           2 months ago
  • 0.1.2                                ...           2 months ago
  • 0.1.1                                ...           3 months ago
  • 0.1.0                                ...           3 months ago
  • 0.0.25                                ...           4 months ago
  • 0.0.24                                ...           4 months ago
  • 0.0.23                                ...           4 months ago
  • 0.0.22                                ...           4 months ago
  • 0.0.21                                ...           4 months ago
  • 0.0.20                                ...           4 months ago
  • 0.0.19                                ...           4 months ago
  • 0.0.18                                ...           4 months ago
  • 0.0.17                                ...           4 months ago
  • 0.0.16                                ...           5 months ago
  • 0.0.15                                ...           5 months ago
  • 0.0.14                                ...           5 months ago
  • 0.0.13                                ...           5 months ago
  • 0.0.12                                ...           6 months ago
  • 0.0.11                                ...           6 months ago
  • 0.0.10                                ...           6 months ago
  • 0.0.9                                ...           6 months ago
  • 0.0.8                                ...           6 months ago
  • 0.0.7                                ...           6 months ago
  • 0.0.6                                ...           6 months ago
  • 0.0.5                                ...           6 months ago
  • 0.0.4                                ...           6 months ago
  • 0.0.3                                ...           6 months ago
  • 0.0.2                                ...           6 months ago
  • 0.0.1                                ...           6 months ago
Downloads
Today 0
This Week 0
This Month 42
Last Day 0
Last Week 42
Last Month 14
Dependencies (7)
Dev Dependencies (10)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |