6.0.1 • Published 10 months ago
@shopware-ag/jest-preset-sw6-admin v6.0.1
Jest Test preset for Shopware 6 administration unit tests
Default Jest preset for Shopware 6 administration development.
npm install jest @shopware-ag/jest-preset-sw6-admin @babel/preset-env @babel/plugin-proposal-class-properties --save-devSetup
After installaing the necessary required packages, please create a file called babel.config.json right next to your own package.json with the following content:
{
"presets": ["@babel/preset-env"],
"plugins": ["@babel/plugin-proposal-class-properties"]
}Via jest.config.js
Next up, create a file jest.config.js which should contain the following content:
module.exports = {
preset: '@shopware-ag/jest-preset-sw6-admin',
globals: {
adminPath: '<file-path-to-sw6-administration>', // required, e.g. /www/sw6/platform/src/Administration/Resources/app/administration
}
}Options the preset sets up for you
collectCoverage- Code coverage will be generated using the reporters listed undercoverageReporterscoverageReporters- The presets useslcov,text&cloveras coverage reporterswatchPathIgnorePatterns- Ignores thenode_modulesfolder for the watch mode of JestclearMocks- Automatically clear mock calls and instances before every test.moduleFileExtensions- File with the extensionjswill automatically used as extensions your module use.moduleNameMapper- Allcss,less&scssfiles will be mocked and relative paths tosrcare getting mapped to the correct src directorytransform- Transformsjsfiles using babel-jest andtwigfiles are transformed using a custom twig transformer which we use in the administration as wellmodulePathIgnorePatterns- Ignores e2e test specs by defaultsetupFilesAfterEnv- Provides a polyfill for Webpack'require.contextand sets up the global Shopware third-party interface for every test. The object can be accessed usingglobal.Shopwarein test files.testMatch- Matches all files containing.spec.jsin the test directory
5.0.0
10 months ago
6.0.1
10 months ago
6.0.0
10 months ago
4.3.2
1 year ago
4.3.1
1 year ago
4.3.4
1 year ago
4.2.5
1 year ago
4.3.3
1 year ago
4.2.4
2 years ago
4.3.0
1 year ago
4.2.3
2 years ago
4.2.2
2 years ago
4.1.0
2 years ago
4.2.1
2 years ago
4.2.0
2 years ago
4.0.2
3 years ago
3.1.0
3 years ago
3.0.0
3 years ago
4.0.1
3 years ago
4.0.0
3 years ago
2.0.2
3 years ago
2.0.1
4 years ago
2.0.0
4 years ago
2.0.0-beta.3
4 years ago
2.0.0-beta.2
4 years ago
2.0.0-beta.1
4 years ago
1.1.2-beta.1
5 years ago
1.1.2-beta.0
5 years ago
1.1.1
6 years ago
1.1.0
6 years ago
1.0.3
6 years ago
1.0.2
6 years ago
1.0.1
6 years ago
1.0.0-beta.1
6 years ago
1.0.0-beta.0
6 years ago