npm i @microsoft.azure/autorest.testserver


Local server offering a variety of APIs that can be used to test code generated by AutoRest (https://github.com/Azure/autorest)

by Azure

3.3.46 (see all)License:MITTypeScript:Built-In
npm i @microsoft.azure/autorest.testserver

Test server V2


  • Node.js


  • VSCode, with the following plugins
    • Prettier
    • ESLint
    • EditorConfig


# Start testserver
autorest-testserver run

# Start testserver at given port
autorest-testserver run --port=<port>

# Start testserver without reseting the coverage. This can be used when you are running the test server multiple times to get the full coverage.
autorest-testserver run --appendCoverage

# Stop testserver
autorest-testserver stop

# Stop testserver running at the given port
autorest-testserver stop --port=<port>

# Sepecify the coverage directory
autorest-testserver run --coverageDirectory=<path>

Coverage upload

Upload the coverage produce by the autorest testserver.

autorest-testserver-coverage publish \
  --coverageDirectory=<path> \
  --repo=<repo> \
  --ref=<path> \
  --githubToken=<ghToken> \
  --azStorageAccount=<account> \

Clear coverage folder

Clear the coverage folder. --coverageDirectory is optional. It defaults to ./coverage

autorest-testserver-coverage clear [--coverageDirectory=<path>]


# Install dependencies
npm install

# Start for dev: Will start the server and automatically restart in case there is changes in the files.
npm run start:dev

# Start for running: Will build and start the server
npm run start

# Format all the files(Required for CI). Use prettier vscode extension(or other editor prettier integration) for on save formatting.
npm run format

Writing mock apis

See docs

No alternatives found
No tutorials found
Add a tutorial
No dependencies found

Rate & Review

No reviews found
Be the first to rate