Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@shopware-ag/jest-preset-sw6-admin

Package Overview
Dependencies
Maintainers
5
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shopware-ag/jest-preset-sw6-admin

Jest Test preset for Shopware 6 administration unit tests

  • 1.0.0-beta.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.5K
increased by18.67%
Maintainers
5
Weekly downloads
 
Created
Source

Jest Test preset for Shopware 6 administration unit tests

GitHub GitHub last commit David GitHub release (latest SemVer including pre-releases)

Default Jest preset for Shopware 6 administration development.

npm install @shopware-ag/jest-preset-sw6-admin --save-dev

Setup

Via jest.config.json or jest field in package.json

{
  "preset": "@shopware-ag/jest-preset-sw6-admin
}

Usage

It's important to configure the preset using the following configuration:

module.exports = {
    preset: '@shopware-ag/jest-preset-sw6-admin',
    globals: {
        artifactsPath: 'build/artifacts', // optional
        adminPath: '<path-to-sw6-administration>', // required
        suiteName: 'My Shopware 6 jest test suite' // optional
    }
}

Options the preset sets up for you

  • collectCoverage - Code coverage will be generated using the reporters listed under coverageReporters
  • coverageReporters - The presets uses lcov, text & clover as coverage reporters
  • coverageDirectory - Code coverage will be generated into the globals.artifactsPath, if undefined, it will be generated into the folder which contains the jest.config.js / package.json file
  • watchPathIgnorePatterns - Ignores the node_modules folder for the watch mode of Jest
  • clearMocks - Automatically clear mock calls and instances before every test.
  • moduleFileExtensions - File with the extension js will automatically used as extensions your module use.
  • moduleNameMapper - All css, less & scss files will be mocked and relative paths to src are getting mapped to the correct src directory
  • transform - Transforms js files using babel-jest and twig files are transformed using a custom twig transformer which we use in the administration as well
  • modulePathIgnorePatterns - Ignores e2e test specs by default
  • setupFilesAfterEnv - Provides a polyfill for Webpack' require.context and sets up the global Shopware third-party interface for every test. The object can be accessed using global.Shopware in test files.
  • testMatch - Matches all files containing .spec.js in the test directory
  • reporters - Uses the reporters default and jest-junit. jest-junit is automatically configured. It can be customized using global.suiteName & global.artifactsPath

Keywords

FAQs

Package last updated on 12 Feb 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc