
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
contentfaux
Advanced tools
A way to stub requests to Contentful.
Contentfaux will first need to be setup. It loads real data from a space configured and uses that to perform unit testing locally. Requests made to Contentful are intercepted and Contentfaux feeds the preloaded data instead.
To install, simply use npm
npm i -D contentfaux
You will also need to add variables to allow the setup data to be loaded before testing. This can be added either in your package.json file, or with environment variables.
If you choose to use the package.json approach, add the following parameters to your package.json file.
{
...
"config": {
"contentfaux": {
"spaceid": "abcd1234",
"apikey": "aaaabbbbccccdddd1111222233334444",
"dir": "path/to/directory"
}
}
}
/approot/contentfaux
.Alternatively, if you choose to use environment variables, the following can be used:
CONTENTFAUX_SPACEID=abcd1234
CONTENTFAUX_APIKEY=aaaabbbbccccdddd1111222233334444
CONTENTFAUX_DIR=path/to/directory
After it has been installed, add this block to your scripts in package.json:
{
"scripts": {
...,
"contentfaux": "contentfaux setup"
}
}
And run it!
npm run contentfaux
To stub, before calling any Contentful-related tests, include Contentfaux
.
require('contentfaux')
or
import 'contentfaux'
If you choose to do other tests with Contentful, be sure to keep a reference of Contentfaux and unstub.
const Contentfaux = require('contentfaux')
...
Contentfaux.unstub()
or
import Contentfaux from 'contentfaux'
...
Contentfaux.unstub()
MIT
FAQs
A way to stub requests to Contentful.
The npm package contentfaux receives a total of 2 weekly downloads. As such, contentfaux popularity was classified as not popular.
We found that contentfaux demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.