Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@rockpack/tester

AlexSergey338MIT6.0.5

Small wrapper for Jest and testing best practice.

jest, testing-library, react, react-testing

readme

Rockpack

@rockpack/tester

@rockpack/tester is Jest with cool config, add-ons and fully compatible with TS / Babel.

@rockpack/tester includes several recommended modules and a test report generator.

@rockpack/tester this module is part of the Rockpack project. See more details on the official site.

Reporter:

Using

  1. Installation:
# NPM
npm install @rockpack/tester --save-dev

# YARN
yarn add @rockpack/tester --dev
  1. Make tests.js in the root of project

  2. Put the code in tests.js

const tests = require('@rockpack/tester');

tests();
  1. Run the script `shell script node tests.js

    or DEV mode
    ```shell script
    node tests.js --watch
  2. Create something.spec.js in src folder of the project and write Jest test

Please see "examples" folder - here

Tricks

If you need override testEnvironment configuration from JSDom (React App) to Node, you should:

  1. Create "jest.extend.js" file in the root of the project

  2. Put the code inside:

module.exports = {
  testEnvironment: 'node',
};

The MIT License

MIT

changelog

Changelog

[6.0.0]

  • React 19 supports in all templates
  • All dependencies were updated
  • Fix vulnerabilities issues
  • Templates simplification
  • Performance improvements

[5.0.0]

  • Zero vulnerabilities for all packages
  • Replaced imagemin to sharp
  • Dropped mandatory "I" prefix for interfaces
  • Dropped deprecated babel plugins
  • Removed unused modules
  • Dropped addons from tester package. Improves customization.
  • Added support CJS and ESM types for library template
  • Added Updater module to update dependencies automatically

[4.5.0]

  • Templates were refactored
  • Changed react-router notation to the object style
  • All dependencies were updated

[4.4.0]

  • ESLint 9 support
  • Refactoring
  • All dependencies were updated

[4.3.0]

  • ESLint 9 preparation for use
  • Bug fixing
  • Refactoring
  • All dependencies were updated

[4.2.0]

  • Fixed bugs in libraryCompiler
  • Provided ability to modify modules and plugins in compilers. The example for the customization compiler was updated regarding these changes.

[4.1.0]

[4.0.0]

  • A lot of fixes and optimizations
  • Rework @rockpack/codestyle module:
  • @rockpack/codestyle module integrated to each of project
  • React Pure project added (include React, React-Dom only)
  • Adopt the code to use iSSR the new version
  • All dependencies were updated

[3.0.0]

  • A lot of fixes and optimizations
  • The new @rockpack/codestyle module with best practices
    • Prettier added
    • Stylelint added
    • Commitlint added
    • Lintstaged added
    • Replaced simple-git-hooks to husky
  • Typescript by default
  • All dependencies were updated

[2.0.0]

  • A lot of fixes and optimizations
  • All dependencies were updated
  • The new React application templates
  • webpack-plugin-serve -> webpack-dev-server4
  • the new official site

[1.9.0]

  • babel config extend added

[1.8.0]

  • webpack-dev-server -> webpack-plugin-serve
  • @rockpack/compiler simplification
  • @rockpack/webpack-plugin-ussr-development added

[1.6.1]

  • Babel-ussr-plugin -> babel-plugin-ussr-marker

[1.6.0]

  • Babel-ussr-plugin added
  • ts-loader, ts-jest -> @babel/preset-typescript

[1.5.0]

[1.1.0]

  • fix(@rockpack/compiler): Side effects
  • Small fixes
  • added: Backbone for E2E tests

BREAKING CHANGES:

  • Simplification of USSR API
  • .modules.(s)css/less -> .module.(s)css/less (create-react-app compatibility)

[1.0.0]