New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

@lwc/jest-resolver

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lwc/jest-resolver

Jest resolver to resolve LWC specific packages


Version published
Maintainers
11
Created

lwc-jest-resolver

The default Jest resolver for finding lwc-* modules. This project leverages lwc-npm-resolver to allow LWC components to import modules by their shorthand. For example, lwc-engine can be imported simply as engine.

For more info on resolvers see the Jest doc.

Requirements

  • Node 8.x
  • NPM 5.x
  • Yarn >= 1.0.0
  • Jest >= 21.x

Usage

This resolver will be included as part of LWCs preset Jest configuration. Follow directions on the official doc to use the presets. For example:

{
  "jest": {
    "preset": "lwc-jest-preset"
  }
}

Alternatively, you can directly set the resolver in your config. For example:

{
  "jest": {
    "resolver": "lwc-jest-resolver"
  }
}

If you are writing your own custom resolver, you can point Jest to your resolver and then delegate to this resolver directly, which in turn delegates to the Jest default resolver.

Keywords

FAQs

Package last updated on 25 Feb 2019

Did you know?

Socket

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.

Install

Related posts