Skip to content

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

License

Notifications You must be signed in to change notification settings

Azure/autorest.testserver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

c04d3fe · Feb 8, 2025
Mar 8, 2024
Feb 24, 2022
Feb 24, 2022
Mar 1, 2022
May 19, 2023
Dec 19, 2019
Apr 16, 2024
Jun 29, 2023
Jan 15, 2021
Feb 25, 2022
Apr 16, 2024
Feb 24, 2022
Feb 8, 2025
Dec 18, 2019
Jun 3, 2022
Feb 24, 2022
Feb 24, 2022
Aug 14, 2017
Feb 24, 2022
Jun 3, 2022
Jan 15, 2021
Feb 8, 2025
Feb 2, 2025
Feb 24, 2022
Jan 15, 2021
Jan 15, 2021

Repository files navigation

Test server V2

Requirements

  • Node.js

Recommended:

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

Usage

# 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> \
  --azStorageAccessKey=<azStorageKey>

Clear coverage folder

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

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

Developping

# 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

About

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

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published