Skip to content

[Feature]: Mock all files with certain extension #649

@akcyp

Description

@akcyp

What problem does this feature solve?

In Jest it's common to create following configuration to ignore / mock files with certain file extensions (css, less, scss, png, etc.).

{
  "moduleNameMapper": {
    "\\.(css|less|scss)$": "<rootDir>/src/Mocks/styleMock.js" // module.exports = {}
  }
}

It seems that in the case of rstest this is not so easy to achieve without a custom plugin.

What does the proposed API look like?

Support regexpes in resolve.alias or create native "ignore" plugin that will override files content with empty export.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions