
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@serenity-js/rest
Advanced tools
Serenity/JS is a node.js library designed to make acceptance and regression testing of modern full-stack applications faster, more collaborative and easier to scale.
The @serenity-js/rest
module let's you interact with and test HTTP REST APIs.
Learn more at serenity-js.org!
import { Actor } from '@serenity-js/core';
import { CallAnApi, DeleteRequest, GetRequest, LastResponse, PostRequest, Send } from '@serenity-js/rest'
import { Ensure, equals, startsWith } from '@serenity-js/assertions';
const actor = Actor.named('Apisit').whoCan(CallAnApi.at('https://myapp.com/api'));
actor.attemptsTo(
// no users present in the system
Send.a(GetRequest.to('/users')),
Ensure.that(LastResponse.status(), equals(200)),
Ensure.that(LastResponse.body(), equals([])),
// create a new test user account
Send.a(PostRequest.to('/users').with({
login: 'tester',
password: 'P@ssword1',
}),
Ensure.that(LastResponse.status(), equals(201)),
Ensure.that(LastResponse.header('Location'), startsWith('/users')),
// delete the test user account
Send.a(DeleteRequest.to(LastResponse.header('Location'))),
Ensure.that(LastResponse.status(), equals(200)),
);
FAQs
Serenity/JS Screenplay Pattern library for interacting with REST and other HTTP-based services, supporting comprehensive API testing and blended testing scenarios
The npm package @serenity-js/rest receives a total of 12,132 weekly downloads. As such, @serenity-js/rest popularity was classified as popular.
We found that @serenity-js/rest demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.