We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If one wants to import store/actions.js on tests, we need to mock this file. This snippet should work:
store/actions.js
const snakeCase = require('lodash/snakeCase') const action = (prefix) => new Proxy({}, { get: (target, suffix) => () => ({ type: snakeCase(`${prefix}_${suffix}`).toUpperCase() }), apply: (target, thisArg, argumentsList) => () => ({ type: snakeCase(prefix).toUpperCase() }) }) const actions = new Proxy({}, { get: (target, property) => { if (/^[A-Z_]+$/.test(property)) { return property } return action(property) } }) module.exports = actions
The text was updated successfully, but these errors were encountered:
No branches or pull requests
If one wants to import
store/actions.js
on tests, we need to mock this file. This snippet should work:The text was updated successfully, but these errors were encountered: