Add comprehensive test coverage for unsupported Postman APIs and ensure
consistent error messages across pre-request and post-request contexts.
Test improvements:
- Expand coverage from 13 to 25 unsupported APIs (50 tests total)
- Add missing APIs: collectionVariables.set/unset/has/clear/toObject,
vault.set/unset, iterationData.set/unset/has/toJSON
- Fix assertions to match actual error format with prefix
- Add pre-request context test for pm.execution.location
Implementation fixes:
- Add missing pm.iterationData.toJSON() in pre-request.js
- Sync post-request.js collectionVariables error messages to match
pre-request.js ("use environment or request variables instead")
|
||
|---|---|---|
| .. | ||
| src | ||
| .eslintrc.cjs | ||
| .gitignore | ||
| .prettierignore | ||
| .prettierrc.cjs | ||
| index.d.ts | ||
| node.d.ts | ||
| package.json | ||
| README.md | ||
| setupFiles.ts | ||
| tsconfig.json | ||
| vite.config.ts | ||
| web.d.ts | ||
Hoppscotch JavaScript Sandbox ALPHA
This package deals with providing a JavaScript sandbox for executing various security sensitive external scripts.
How does this work?
This package makes use of quickjs-emscripten for building sandboxes for running external code on Hoppscotch.
Currently implemented sandboxes:
- Hoppscotch Test Scripts
- Hoppscotch Pre Request Scripts
Development
- Clone the repository
git clone https://github.com/hoppscotch/hoppscotch
- Install the package dependencies
pnpm install
- Navigate to the package folder
cd hoppscotch/packages/hoppscotch-js-sandbox
- Try out the demo
src/demo.tsusing:
npm run demo
Versioning
This project follows Semantic Versioning but as the project is still pre-1.0. The code and the public exposed API should not be considered to be fixed and stable. Things can change at any time!
License
This project is licensed under the MIT License - see LICENSE for more details.