
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.
@unleash/client-specification
Advanced tools
A collection of test specifications to guide client implementations in various languages
Implementing a Unleash client for a specific platfrom can be a challenge in it's own. And we want the clients to follow specific platform and language conventions, but at the same time we want the clients to adhere to the unleash contract, and give predictable results across platforms.
This project tries to define the expected results of certain predefined set of feature toggles, using the built-in activation strategies and with a given unleash context.
All the tests are located in the /specifications folder.
There is an entry point for all the tests, which will include a list of all the defined specification test cases, /specifications/index.json. Clients should parse this entry-point in order to discover all specifications to run.
[
"01-simple-examples.json",
"02-user-with-id-strategy.json",
"03-gradual-rollout-user-id-strategy.json",
"04-gradual-rollout-session-id-strategy.json",
"05-gradual-rollout-random-strategy.json",
"06-remote-address-strategy.json",
"07-multiple-strategies.json",
"08-variants.json",
"09-strategy-constraints.json",
"10-flexible-rollout-strategy.json",
"11-strategy-constraints-edge-cases.json",
"12-custom-stickiness.json",
"13-constraint-operators.json",
"14-constraint-semver-operators.json"
"15-global-constraints.json"
]
A Test Specifications will have the following shape:
{
"name": "Example Test Case",
"state": {
"version": 1,
"features": []
},
"tests": [
{
"description": "Unknown toggle should be disabled",
"context": {},
"toggleName": "Unknown.Toggle",
"expectedResult": false
}
],
"variantTests": [
{
"description": "Feature with variants",
"context": {
"userId": "1234"
},
"toggleName": "Feature.Variants",
"expectedResult": {
"name": "variant",
"payload": {
"type": "string",
"value": "value"
},
"enabled": true
}
}
]
}
Fields description:
http://unleash-api/client/features
. The state will be used for all test cases in this specification.isEnabled
tests cases to run.
isEnabled
call in this test case.isEnabled
call with the given toggleName
.getVariant
tests cases to run.
isEnabled
call in this test case.getVariant
call with the given toggleName
.FAQs
A collection of test specifications to guide client implementations in various languages
The npm package @unleash/client-specification receives a total of 31 weekly downloads. As such, @unleash/client-specification popularity was classified as not popular.
We found that @unleash/client-specification 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.