skip to Main Content

Testing Redis functionalities with Jest

I have the following file that connect to a redis database: index.js const redis = require('redis'); const logger = require('../logger'); const config = require('../env'); const client = redis.createClient({ host: config.redis.host, port: config.redis.port }); const connect = () => { client.on('connect',…

VIEW QUESTION

Woocommerce – How to mock an API call with configuration in JEST?

I am using @woocommerce/woocommerce-rest-api package for my api. I am using NextJS and React Redux. Here is my woocommerce configuration: import WooCommerceRestApi from '@woocommerce/woocommerce-rest-api'; export const wooApi = new WooCommerceRestApi({ url: 'MY_API_URL', consumerKey: 'MY_CONSUMER_KEY', consumerSecret: 'MY_CONSUMER_SECRET', version: 'wc/v3', queryStringAuth: true,…

VIEW QUESTION
Back To Top
Search