
Security News
OWASP 2025 Top 10 Adds Software Supply Chain Failures, Ranked Top Community Concern
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.
Library for runnning tests suite on http request responses.
$ npm intall taws const { TestsRunner } = require('taws');
//example tests suite configuration
const params = {
"name" : "example_tests_suite",
"config" : [{
"type" : "request",
"options" : {
"method" : "GET",
"url" : "https://restcountries.eu/rest/v2/name/Poland",
"headers" : {}
},
"tests" : [{
"type" : "regexp",
"key" : "[0].name",
"value" : "Poland"
}]
}]
};
const runner = new TestsRunner();
let promiseChain = runner.run(params.config);
promiseChain
.then((result) => {
console.info('TEST - %s - name=%s tests_overall=%s tests_failed=%s duration=%s ms',
result.testsSuiteId,
params.name,
result.testsRun,
result.testsFail,
result.endTime - result.startTime
)
})
.catch((error) => {
console.error(error);
});
By default, logging of processing tests is enabled, if you want to disable this,
pass object with silentModel property set to true to TestRunner constructor.
//example tests suite configuration
const options={
silentMode: true
};
const runner = new TestsRunner(options);
Taws TestsRunner run method accepts tests suite to run.
Example of tests suite definition:
{
"name" : "pulse2story_save",
"config" : [{
"type" : "request",
"options" : {
"method" : "GET",
"url" : "https://restcountries.eu/rest/v2/name/Poland",
"headers" : {
"cache-control" : "no-cache"
}
},
"tests" : [{
"type" : "regexp",
"key" : "[0].name",
"value" : "Poland"
}
]
},
{
"type": "delay",
"time": 6000
}
]
}
Tests suite consists of two keys: name and config
name is a name of tests suite
config is a set of action definitions to perform within the tests suite. See action-definition for more information.
Tests suite configuration consist of actions that are executed synchronously in defined order.
There are two types of actions to use
request type - run http request
Requires options key with request definition ( see https://github.com/request/request )
{
"type" : "request",
"options" : {
"method" : "GET",
"url" : "https://restcountries.eu/rest/v2/name/Poland",
"headers" : {
"cache-control" : "no-cache"
}
}
If you want to retry request when error occurs, add retries key with the desired number of retries
{
"type" : "request",
"retries": 2,
"options" : {
"method" : "GET",
"url" : "https://restcountries.eu/rest/v2/name/Poland",
"headers" : {
"cache-control" : "no-cache"
}
}
This action accepts a tests definition to run on a response of request.
See test-definition section.
delay type - wait specified time before executing next action
Requires time key with number of miliseconds to wait
{
"type": "delay",
"time": 6000
}
Every "request" step allows to specify tests, that will be run in order to check correctness of the response. Tests property is an array, where every object represents one condition.
Example:
"tests" :
[{
"type" : "regexp",
"key" : "[0].name",
"value" : "Poland"
}, {
"type" : "regexp",
"key" : "[0].capital",
"value" : "Warsaw"
}, {
"type" : "regexp",
"key" : "[0].region",
"value" : "(Europe|europe)"
}]
Single test definition consist of following key:
type - Type of test. Only regexp type is available.
key - Path in response's object, which value will be tested against regexp
value - Regexp to test the value.
Every request action and tests definition can use data from previous requests response.
Responses of previous requests are available under response[index] variable, where index
corresponds to requests order.
For example, to access response of first request use response[0] variable, for second response[1] etc..
Below you find common use examples:
Using name key from response of first request in URL of the next
{
"type" : "request",
"options" : {
"method" : "POST",
"url" : "https://myexampleapiendoint.com/${response[0].name}",
"headers" : {
"cache-control" : "no-cache",
"my-custom-header": "example-header"
},
"body" : {
"data": {
"age": 25
}
}
}
}
To validate tests suite definition, validateConfig method is available.
Arguments:
testConfig - test suite definition
throwError - decides if excepion should be trowed when validation of tests suite fail
Example:
const { validateConfig } = require('taws');
try {
validateConfig(testConfig, true);
} catch (error) {
console.warn('Schema validation error:', error);
}
FAQs
A library for testing responses of requests
The npm package taws receives a total of 2 weekly downloads. As such, taws popularity was classified as not popular.
We found that taws demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.