Skip to content

Latest commit

 

History

History
60 lines (41 loc) · 1.02 KB

test.md

File metadata and controls

60 lines (41 loc) · 1.02 KB

@umijs/test

Break Changes

  • jest.config.js 中的配置默认为覆盖,而不是扩展,如需扩展,把值改成函数的形式
  • 不再内置 enzyme 方案,推荐用 @testing-library/react
  • 使用 jsdom@14,不再支持 node 6

Usage

$ umi-test

# watch mode
$ umi-test -w
$ umi-test --watch

# collect coverage
$ umi-test --coverage

# print debug info
$ umi-test --debug

# test specified package for lerna package
$ umi-test --package name

# don't do e2e test
$ umi-test --no-e2e

Features

Support modify default config with function in jest.config.js

module.exports = {
  moduleNameMapper(memo) {
    return {
      ...memo,
      '^umi$': require.resolve('umi'),
    };
  },
};

Support lerna package

Support typescript

Built-in Polyfills

  • core-js/stable
  • regenerator-runtime/runtime
  • whatwg-fetch

Support get config from jest.config.js and package.json

jest.config.js 的优先级更高。

FAQ