Shreyas 3de3209d5e fix(cli): use os-specific invalid paths for tests (#4518) | 1 week ago | |
---|---|---|
.. | ||
bin | 7 months ago | |
src | 1 week ago | |
.gitignore | 2 years ago | |
.prettierrc | 2 years ago | |
CONTRIBUTING.md | 2 years ago | |
README.md | 6 months ago | |
package.json | 2 weeks ago | |
setupFiles.ts | 4 months ago | |
tsconfig.json | 3 months ago | |
tsup.config.ts | 9 months ago | |
vitest.config.ts | 4 months ago |
A CLI to run Hoppscotch Test Scripts in CI environments.
hopp test [options] [file]
: testing hoppscotch collection.json filehopp [options or commands] arguments
-v
, --ver
: see the current version of the CLI-h
, --help
: display help for commandhopp -v
/ hopp --ver
hopp -h
/ hopp --help
hopp test [options] <file_path>
-e <file_path>
/ --env <file_path>
Accepts path to env.json with contents in below format:
{
"ENV1":"value1",
"ENV2":"value2"
}
You can now access those variables using pw.env.get('<var_name>')
Taking the above example, pw.env.get("ENV1")
will return "value1"
Before you install Hoppscotch CLI you need to make sure you have the dependencies it requires to run.
node-gyp
installed. Find instructions here: https://github.com/nodejs/node-gypDebian/Ubuntu derivatives:
sudo apt-get install python g++ build-essential
Alpine Linux:
sudo apk add python3 make g++
Amazon Linux (AMI)
sudo yum install gcc72 gcc72-c++
Arch Linux
sudo pacman -S make gcc python
RHEL/Fedora derivatives:
sudo dnf install python3 make gcc gcc-c++ zlib-devel brotli-devel openssl-devel libuv-devel
Once the dependencies are installed, install @hoppscotch/cli from npm by running:
npm i -g @hoppscotch/cli
pnpm install
cd packages/hoppscotch-cli
pnpm run build
sudo pnpm link --global
hopp
When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.
Please note we have a code of conduct, please follow it in all your interactions with the project.
After cloning the repository, execute the following commands:
pnpm install
pnpm run build
In order to test locally, you can use two types of package linking:
The 'pnpm exec' way (preferred since it does not hamper your original installation of the CLI):
pnpm link @hoppscotch/cli
// Then to use or test the CLI:
pnpm exec hopp
// After testing, to remove the package linking:
pnpm rm @hoppscotch/cli
The 'global' way (warning: this might override the globally installed CLI, if exists):
sudo pnpm link --global
// Then to use or test the CLI:
hopp
// After testing, to remove the package linking:
sudo pnpm rm --global @hoppscotch/cli
To use the Typescript watch scripts:
pnpm run dev