321 lines
77 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en-US" dir="ltr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>@fesjs/plugin-jest | Fes.js</title>
<meta name="description" content="一个好用的前端应用解决方案">
<link rel="preload stylesheet" href="/fes.js/assets/style.9b2080ed.css" as="style">
<script type="module" src="/fes.js/assets/app.5c085c23.js"></script>
<link rel="preload" href="/fes.js/assets/inter-roman-latin.2ed14f66.woff2" as="font" type="font/woff2" crossorigin="">
<link rel="modulepreload" href="/fes.js/assets/chunks/framework.85b09291.js">
<link rel="modulepreload" href="/fes.js/assets/chunks/theme.1ddd4103.js">
<link rel="modulepreload" href="/fes.js/assets/reference_plugin_plugins_jest.md.4b1c2ebf.lean.js">
<link rel="icon" href="/logo.png">
<script id="check-dark-light">(()=>{const e=localStorage.getItem("vitepress-theme-appearance")||"",a=window.matchMedia("(prefers-color-scheme: dark)").matches;(!e||e==="auto"?a:e==="dark")&&document.documentElement.classList.add("dark")})();</script>
</head>
<body>
<div id="app"><div class="Layout" data-v-d3edc1d3><!--[--><!--]--><!--[--><span tabindex="-1" data-v-59268664></span><a href="#VPContent" class="VPSkipLink visually-hidden" data-v-59268664> Skip to content </a><!--]--><!----><header class="VPNav" data-v-d3edc1d3 data-v-31544dc1><div class="VPNavBar has-sidebar" data-v-31544dc1 data-v-518cc426><div class="container" data-v-518cc426><div class="title" data-v-518cc426><div class="VPNavBarTitle has-sidebar" data-v-518cc426 data-v-9f409f7c><a class="title" href="/fes.js/" data-v-9f409f7c><!--[--><!--]--><!--[--><img class="VPImage logo" src="/fes.js/logo.png" alt data-v-74f25ba3><!--]--><!--[-->Fes.js<!--]--><!--[--><!--]--></a></div></div><div class="content" data-v-518cc426><div class="curtain" data-v-518cc426></div><div class="content-body" data-v-518cc426><!--[--><!--]--><div class="VPNavBarSearch search" style="--vp-meta-key:&#39;Meta&#39;;" data-v-518cc426><!--[--><!----><div id="local-search"><button type="button" class="DocSearch DocSearch-Button" aria-label="Search"><span class="DocSearch-Button-Container"><svg class="DocSearch-Search-Icon" width="20" height="20" viewBox="0 0 20 20" aria-label="search icon"><path d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z" stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"></path></svg><span class="DocSearch-Button-Placeholder">Search</span></span><span class="DocSearch-Button-Keys"><kbd class="DocSearch-Button-Key"></kbd><kbd class="DocSearch-Button-Key">K</kbd></span></button></div><!--]--></div><nav aria-labelledby="main-nav-aria-label" class="VPNavBarMenu menu" data-v-518cc426 data-v-59f637f9><span id="main-nav-aria-label" class="visually-hidden" data-v-59f637f9>Main Navigation</span><!--[--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/fes.js/guide/" tabindex="0" data-v-59f637f9 data-v-eff41f9d data-v-83901ecb><!--[-->指南<!--]--><!----></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/fes.js/reference/config/" tabindex="0" data-v-59f637f9 data-v-eff41f9d data-v-83901ecb><!--[-->编译时配置<!--]--><!----></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/fes.js/reference/api/" tabindex="0" data-v-59f637f9 data-v-eff41f9d data-v-83901ecb><!--[-->API<!--]--><!----></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink active" href="/fes.js/reference/plugin/" tabindex="0" data-v-59f637f9 data-v-eff41f9d data-v-83901ecb><!--[-->插件<!--]--><!----></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/fes.js/reference/cli/index.html" tabindex="0" data-v-59f637f9 data-v-eff41f9d data-v-83901ecb><!--[-->CLI<!--]--><!----></a><!--]--><!--[--><div class="VPFlyout VPNavBarMenuGroup" data-v-59f637f9 data-v-66a2feed><button type="button" class="button" aria-haspopup="true" aria-expanded="false" data-v-66a2feed><span class="text" data-v-66a2feed><!----> v3.1.1 <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="text-icon" data-v-66a2feed><path d="M12,16c-0.3,0-0.5-0.1-0.7-0.3l-6-6c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l5.3,5.3l5.3-5.3c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-6,6C12.5,15.9,12.3,16,12,16z"></path></svg></span></button><div class="menu" data-v-66a2feed><div class="VPMenu" data-v-66a2feed data-v-2548f0fa><div class="items" data-v-2548f0fa><!--[--><!--[--><div class="VPMenuLink" data-v-2548f0fa data-v-5cbd515c><a class="VPLink link" href="https://fesjs.mumblefe.cn/2.0/" target="_blank" rel="noreferrer" data-v-5cbd515c data-v-83901ecb><!--[-->v2.0<!--]--><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" height="24px" viewbox="0 0 24 24" width="24px" class="icon" data-v-83901ecb><path d="M0 0h24v24H0V0z" fill="none"></path><path d="M9 5v2h6.59L4 18.59 5.41 20 17 8.41V15h2V5H9z"></path></svg></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-2548f0fa data-v-5cbd515c><a class="VPLink link" href="https://fesjs.mumblefe.cn/1.0/" target="_blank" rel="noreferrer" data-v-5cbd515c data-v-83901ecb><!--[-->v1.0<!--]--><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" height="24px" viewbox="0 0 24 24" width="24px" class="icon" data-v-83901ecb><path d="M0 0h24v24H0V0z" fill="none"></path><path d="M9 5v2h6.59L4 18.59 5.41 20 17 8.41V15h2V5H9z"></path></svg></a></div><!--]--><!--]--></div><!--[--><!--]--></div></div></div><!--]--><!--[--><div class="VPFlyout VPNavBarMenuGroup" data-v-59f637f9 data-v-66a2feed><button type="button" class="button" aria-haspopup="true" aria-expanded="false" data-v-66a2feed><span class="text" data-v-66a2feed><!----> 了解更多 <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="text-icon" data-v-66a2feed><path d="M12,16c-0.3,0-0.5-0.1-0.7-0.3l-6-6c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l5.3,5.3l5.3-5.3c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-6,6C12.5,15.9,12.3,16,12,16z"></path></svg></span></button><div class="menu" data-v-66a2feed><div class="VPMenu" data-v-66a2feed data-v-2548f0fa><div class="items" data-v-2548f0fa><!--[--><!--[--><div class="VPMenuLink" data-v-2548f0fa data-v-5cbd515c><a class="VPLink link" href="https://github.com/WeBankFinTech/fes.js/blob/master/CHANGELOG.md" target="_blank" rel="noreferrer" data-v-5cbd515c data-v-83901ecb><!--[-->更新日志<!--]--><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" height="24px" viewbox="0 0 24 24" width="24px" class="icon" data-v-83901ecb><path d="M0 0h24v24H0V0z" fill="none"></path><path d="M9 5v2h6.59L4 18.59 5.41 20 17 8.41V15h2V5H9z"></path></svg></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-2548f0fa data-v-5cbd515c><a class="VPLink link" href="http://fes-design.mumblefe.cn/" target="_blank" rel="noreferrer" data-v-5cbd515c data-v-83901ecb><!--[-->fes-design<!--]--><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" height="24px" viewbox="0 0 24 24" width="24px" class="icon" data-v-83901ecb><path d="M0 0h24v24H0V0z" fill="none"></path><path d="M9 5v2h6.59L4 18.59 5.41 20 17 8.41V15h2V5H9z"></path></svg></a></div><!--]--><!--]--></div><!--[--><!--]--></div></div></div><!--]--><!--]--></nav><!----><div class="VPNavBarAppearance appearance" data-v-518cc426 data-v-0f013d30><label title="toggle dark mode" data-v-0f013d30 data-v-a115155e><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" aria-checked="false" data-v-a115155e data-v-5559e67f><span class="check" data-v-5559e67f><span class="icon" data-v-5559e67f><!--[--><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="sun" data-v-a115155e><path d="M12,18c-3.3,0-6-2.7-6-6s2.7-6,6-6s6,2.7,6,6S15.3,18,12,18zM12,8c-2.2,0-4,1.8-4,4c0,2.2,1.8,4,4,4c2.2,0,4-1.8,4-4C16,9.8,14.2,8,12,8z"></path><path d="M12,4c-0.6,0-1-0.4-1-1V1c0-0.6,0.4-1,1-1s1,0.4,1,1v2C13,3.6,12.6,4,12,4z"></path><path d="M12,24c-0.6,0-1-0.4-1-1v-2c0-0.6,0.4-1,1-1s1,0.4,1,1v2C13,23.6,12.6,24,12,24z"></path><path d="M5.6,6.6c-0.3,0-0.5-0.1-0.7-0.3L3.5,4.9c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l1.4,1.4c0.4,0.4,0.4,1,0,1.4C6.2,6.5,5.9,6.6,5.6,6.6z"></path><path d="M19.8,20.8c-0.3,0-0.5-0.1-0.7-0.3l-1.4-1.4c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l1.4,1.4c0.4,0.4,0.4,1,0,1.4C20.3,20.7,20,20.8,19.8,20.8z"></path><path d="M3,13H1c-0.6,0-1-0.4-1-1s0.4-1,1-1h2c0.6,0,1,0.4,1,1S3.6,13,3,13z"></path><path d="M23,13h-2c-0.6,0-1-0.4-1-1s0.4-1,1-1h2c0.6,0,1,0.4,1,1S23.6,13,23,13z"></path><path d="M4.2,20.8c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l1.4-1.4c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-1.4,1.4C4.7,20.7,4.5,20.8,4.2,20.8z"></path><path d="M18.4,6.6c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l1.4-1.4c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-1.4,1.4C18.9,6.5,18.6,6.6,18.4,6.6z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="moon" data-v-a115155e><path d="M12.1,22c-0.3,0-0.6,0-0.9,0c-5.5-0.5-9.5-5.4-9-10.9c0.4-4.8,4.2-8.6,9-9c0.4,0,0.8,0.2,1,0.5c0.2,0.3,0.2,0.8-0.1,1.1c-2,2.7-1.4,6.4,1.3,8.4c2.1,1.6,5,1.6,7.1,0c0.3-0.2,0.7-0.3,1.1-0.1c0.3,0.2,0.5,0.6,0.5,1c-0.2,2.7-1.5,5.1-3.6,6.8C16.6,21.2,14.4,22,12.1,22zM9.3,4.4c-2.9,1-5,3.6-5.2,6.8c-0.4,4.4,2.8,8.3,7.2,8.7c2.1,0.2,4.2-0.4,5.8-1.8c1.1-0.9,1.9-2.1,2.4-3.4c-2.5,0.9-5.3,0.5-7.5-1.1C9.2,11.4,8.1,7.7,9.3,4.4z"></path></svg><!--]--></span></span></button></label></div><div class="VPSocialLinks VPNavBarSocialLinks social-links" data-v-518cc426 data-v-68be864b data-v-036d02a2><!--[--><a class="VPSocialLink" href="https://github.com/WeBankFinTech/fes.js" aria-label="github" target="_blank" rel="noopener" data-v-036d02a2 data-v-5ea6463d><svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>GitHub</title><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg></a><!--]--></div><div class="VPFlyout VPNavBarExtra extra" data-v-518cc426 data-v-22c4504f data-v-66a2feed><button type="button" class="button" aria-haspopup="true" aria-expanded="false" aria-label="extra navigation" data-v-66a2feed><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="icon" data-v-66a2feed><circle cx="12" cy="12" r="2"></circle><circle cx="19" cy="12" r="2"></circle><circle cx="5" cy="12" r="2"></circle></svg></button><div class="menu" data-v-66a2feed><div class="VPMenu" data-v-66a2feed data-v-2548f0fa><!----><!--[--><!--[--><!----><div class="group" data-v-22c4504f><div class="item appearance" data-v-22c4504f><p class="label" data-v-22c4504f>Appearance</p><div class="appearance-action" data-v-22c4504f><label title="toggle dark mode" data-v-22c4504f data-v-a115155e><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" aria-checked="false" data-v-a115155e data-v-5559e67f><span class="check" data-v-5559e67f><span class="icon" data-v-5559e67f><!--[--><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="sun" data-v-a115155e><path d="M12,18c-3.3,0-6-2.7-6-6s2.7-6,6-6s6,2.7,6,6S15.3,18,12,18zM12,8c-2.2,0-4,1.8-4,4c0,2.2,1.8,4,4,4c2.2,0,4-1.8,4-4C16,9.8,14.2,8,12,8z"></path><path d="M12,4c-0.6,0-1-0.4-1-1V1c0-0.6,0.4-1,1-1s1,0.4,1,1v2C13,3.6,12.6,4,12,4z"></path><path d="M12,24c-0.6,0-1-0.4-1-1v-2c0-0.6,0.4-1,1-1s1,0.4,1,1v2C13,23.6,12.6,24,12,24z"></path><path d="M5.6,6.6c-0.3,0-0.5-0.1-0.7-0.3L3.5,4.9c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l1.4,1.4c0.4,0.4,0.4,1,0,1.4C6.2,6.5,5.9,6.6,5.6,6.6z"></path><path d="M19.8,20.8c-0.3,0-0.5-0.1-0.7-0.3l-1.4-1.4c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l1.4,1.4c0.4,0.4,0.4,1,0,1.4C20.3,20.7,20,20.8,19.8,20.8z"></path><path d="M3,13H1c-0.6,0-1-0.4-1-1s0.4-1,1-1h2c0.6,0,1,0.4,1,1S3.6,13,3,13z"></path><path d="M23,13h-2c-0.6,0-1-0.4-1-1s0.4-1,1-1h2c0.6,0,1,0.4,1,1S23.6,13,23,13z"></path><path d="M4.2,20.8c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l1.4-1.4c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-1.4,1.4C4.7,20.7,4.5,20.8,4.2,20.8z"></path><path d="M18.4,6.6c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l1.4-1.4c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-1.4,1.4C18.9,6.5,18.6,6.6,18.4,6.6z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="moon" data-v-a115155e><path d="M12.1,22c-0.3,0-0.6,0-0.9,0c-5.5-0.5-9.5-5.4-9-10.9c0.4-4.8,4.2-8.6,9-9c0.4,0,0.8,0.2,1,0.5c0.2,0.3,0.2,0.8-0.1,1.1c-2,2.7-1.4,6.4,1.3,8.4c2.1,1.6,5,1.6,7.1,0c0.3-0.2,0.7-0.3,1.1-0.1c0.3,0.2,0.5,0.6,0.5,1c-0.2,2.7-1.5,5.1-3.6,6.8C16.6,21.2,14.4,22,12.1,22zM9.3,4.4c-2.9,1-5,3.6-5.2,6.8c-0.4,4.4,2.8,8.3,7.2,8.7c2.1,0.2,4.2-0.4,5.8-1.8c1.1-0.9,1.9-2.1,2.4-3.4c-2.5,0.9-5.3,0.5-7.5-1.1C9.2,11.4,8.1,7.7,9.3,4.4z"></path></svg><!--]--></span></span></button></label></div></div></div><div class="group" data-v-22c4504f><div class="item social-links" data-v-22c4504f><div class="VPSocialLinks social-links-list" data-v-22c4504f data-v-036d02a2><!--[--><a class="VPSocialLink" href="https://github.com/WeBankFinTech/fes.js" aria-label="github" target="_blank" rel="noopener" data-v-036d02a2 data-v-5ea6463d><svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>GitHub</title><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg></a><!--]--></div></div></div><!--]--><!--]--></div></div></div><!--[--><!--]--><button type="button" class="VPNavBarHamburger hamburger" aria-label="mobile navigation" aria-expanded="false" aria-controls="VPNavScreen" data-v-518cc426 data-v-69d5f97f><span class="container" data-v-69d5f97f><span class="top" data-v-69d5f97f></span><span class="middle" data-v-69d5f97f></span><span class="bottom" data-v-69d5f97f></span></span></button></div></div></div></div><!----></header><div class="VPLocalNav" data-v-d3edc1d3 data-v-a608b4c2><button class="menu" aria-expanded="false" aria-controls="VPSidebarNav" data-v-a608b4c2><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="menu-icon" data-v-a608b4c2><path d="M17,11H3c-0.6,0-1-0.4-1-1s0.4-1,1-1h14c0.6,0,1,0.4,1,1S17.6,11,17,11z"></path><path d="M21,7H3C2.4,7,2,6.6,2,6s0.4-1,1-1h18c0.6,0,1,0.4,1,1S21.6,7,21,7z"></path><path d="M21,15H3c-0.6,0-1-0.4-1-1s0.4-1,1-1h18c0.6,0,1,0.4,1,1S21.6,15,21,15z"></path><path d="M17,19H3c-0.6,0-1-0.4-1-1s0.4-1,1-1h14c0.6,0,1,0.4,1,1S17.6,19,17,19z"></path></svg><span class="menu-text" data-v-a608b4c2>Menu</span></button><div class="VPLocalNavOutlineDropdown" style="--vp-vh:0px;" data-v-a608b4c2 data-v-7fc5e44e><button data-v-7fc5e44e>Return to top</button><!----></div></div><aside class="VPSidebar" data-v-d3edc1d3 data-v-084bed16><div class="curtain" data-v-084bed16></div><nav class="nav" id="VPSidebarNav" aria-labelledby="sidebar-aria-label" tabindex="-1" data-v-084bed16><span class="visually-hidden" id="sidebar-aria-label" data-v-084bed16> Sidebar Navigation </span><!--[--><!--]--><!--[--><div class="group" data-v-084bed16><section class="VPSidebarItem level-0" data-v-084bed16 data-v-9b2ca4cb><!----><div class="items" data-v-9b2ca4cb><!--[--><div class="VPSidebarItem level-1 is-link" data-v-9b2ca4cb data-v-9b2ca4cb><div class="item" data-v-9b2ca4cb><div class="indicator" data-v-9b2ca4cb></div><a class="VPLink link link" href="/fes.js/reference/plugin/index.html" data-v-9b2ca4cb data-v-83901ecb><!--[--><p class="text" data-v-9b2ca4cb>介绍</p><!--]--><!----></a><!----></div><!----></div><!--]--></div></section></div><div class="group" data-v-084bed16><section class="VPSidebarItem level-0 has-active" data-v-084bed16 data-v-9b2ca4cb><div class="item" role="button" tabindex="0" data-v-9b2ca4cb><div class="indicator" data-v-9b2ca4cb></div><h2 class="text" data-v-9b2ca4cb>Plugins</h2><!----></div><div class="items" data-v-9b2ca4cb><!--[--><div class="VPSidebarItem level-1 is-link" data-v-9b2ca4cb data-v-9b2ca4cb><div class="item" data-v-9b2ca4cb><div class="indicator" data-v-9b2ca4cb></div><a class="VPLink link link" href="/fes.js/reference/plugin/plugins/access.html" data-v-9b2ca4cb data-v-83901ecb><!--[--><p class="text" data-v-9b2ca4cb>@fesjs/plugin-access</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-9b2ca4cb data-v-9b2ca4cb><div class="item" data-v-9b2ca4cb><div class="indicator" data-v-9b2ca4cb></div><a class="VPLink link link" href="/fes.js/reference/plugin/plugins/enums.html" data-v-9b2ca4cb data-v-83901ecb><!--[--><p class="text" data-v-9b2ca4cb>@fesjs/plugin-enums</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-9b2ca4cb data-v-9b2ca4cb><div class="item" data-v-9b2ca4cb><div class="indicator" data-v-9b2ca4cb></div><a class="VPLink link link" href="/fes.js/reference/plugin/plugins/icon.html" data-v-9b2ca4cb data-v-83901ecb><!--[--><p class="text" data-v-9b2ca4cb>@fesjs/plugin-icon</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link is-active has-active" data-v-9b2ca4cb data-v-9b2ca4cb><div class="item" data-v-9b2ca4cb><div class="indicator" data-v-9b2ca4cb></div><a class="VPLink link link" href="/fes.js/reference/plugin/plugins/jest.html" data-v-9b2ca4cb data-v-83901ecb><!--[--><p class="text" data-v-9b2ca4cb>@fesjs/plugin-jest</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-9b2ca4cb data-v-9b2ca4cb><div class="item" data-v-9b2ca4cb><div class="indicator" data-v-9b2ca4cb></div><a class="VPLink link link" href="/fes.js/reference/plugin/plugins/layout.html" data-v-9b2ca4cb data-v-83901ecb><!--[--><p class="text" data-v-9b2ca4cb>@fesjs/plugin-layout</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-9b2ca4cb data-v-9b2ca4cb><div class="item" data-v-9b2ca4cb><div class="indicator" data-v-9b2ca4cb></div><a class="VPLink link link" href="/fes.js/reference/plugin/plugins/locale.html" data-v-9b2ca4cb data-v-83901ecb><!--[--><p class="text" data-v-9b2ca4cb>@fesjs/plugin-locale</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-9b2ca4cb data-v-9b2ca4cb><div class="item" data-v-9b2ca4cb><div class="indicator" data-v-9b2ca4cb></div><a class="VPLink link link" href="/fes.js/reference/plugin/plugins/model.html" data-v-9b2ca4cb data-v-83901ecb><!--[--><p class="text" data-v-9b2ca4cb>@fesjs/plugin-model</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-9b2ca4cb data-v-9b2ca4cb><div class="item" data-v-9b2ca4cb><div class="indicator" data-v-9b2ca4cb></div><a class="VPLink link link" href="/fes.js/reference/plugin/plugins/request.html" data-v-9b2ca4cb data-v-83901ecb><!--[--><p class="text" data-v-9b2ca4cb>@fesjs/plugin-request</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-9b2ca4cb data-v-9b2ca4cb><div class="item" data-v-9b2ca4cb><div class="indicator" data-v-9b2ca4cb></div><a class="VPLink link link" href="/fes.js/reference/plugin/plugins/vuex.html" data-v-9b2ca4cb data-v-83901ecb><!--[--><p class="text" data-v-9b2ca4cb>@fesjs/plugin-vuex</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-9b2ca4cb data-v-9b2ca4cb><div class="item" data-v-9b2ca4cb><div class="indicator" data-v-9b2ca4cb></div><a class="VPLink link link" href="/fes.js/reference/plugin/plugins/qiankun.html" data-v-9b2ca4cb data-v-83901ecb><!--[--><p class="text" data-v-9b2ca4cb>@fesjs/plugin-qiankun</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-9b2ca4cb data-v-9b2ca4cb><div class="item" data-v-9b2ca4cb><div class="indicator" data-v-9b2ca4cb></div><a class="VPLink link link" href="/fes.js/reference/plugin/plugins/windicss.html" data-v-9b2ca4cb data-v-83901ecb><!--[--><p class="text" data-v-9b2ca4cb>@fesjs/plugin-windicss</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-9b2ca4cb data-v-9b2ca4cb><div class="item" data-v-9b2ca4cb><div class="indicator" data-v-9b2ca4cb></div><a class="VPLink link link" href="/fes.js/reference/plugin/plugins/sass.html" data-v-9b2ca4cb data-v-83901ecb><!--[--><p class="text" data-v-9b2ca4cb>@fesjs/plugin-sass</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-9b2ca4cb data-v-9b2ca4cb><div class="item" data-v-9b2ca4cb><div class="indicator" data-v-9b2ca4cb></div><a class="VPLink link link" href="/fes.js/reference/plugin/plugins/editor.html" data-v-9b2ca4cb data-v-83901ecb><!--[--><p class="text" data-v-9b2ca4cb>@fesjs/plugin-editor</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-9b2ca4cb data-v-9b2ca4cb><div class="item" data-v-9b2ca4cb><div class="indicator" data-v-9b2ca4cb></div><a class="VPLink link link" href="/fes.js/reference/plugin/plugins/pinia.html" data-v-9b2ca4cb data-v-83901ecb><!--[--><p class="text" data-v-9b2ca4cb>@fesjs/plugin-pinia</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-9b2ca4cb data-v-9b2ca4cb><div class="item" data-v-9b2ca4cb><div class="indicator" data-v-9b2ca4cb></div><a class="VPLink link link" href="/fes.js/reference/plugin/plugins/watermark.html" data-v-9b2ca4cb data-v-83901ecb><!--[--><p class="text" data-v-9b2ca4cb>@fesjs/plugin-watermark</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-9b2ca4cb data-v-9b2ca4cb><div class="item" data-v-9b2ca4cb><div class="indicator" data-v-9b2ca4cb></div><a class="VPLink link link" href="/fes.js/reference/plugin/plugins/login.html" data-v-9b2ca4cb data-v-83901ecb><!--[--><p class="text" data-v-9b2ca4cb>@fesjs/plugin-login</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-9b2ca4cb data-v-9b2ca4cb><div class="item" data-v-9b2ca4cb><div class="indicator" data-v-9b2ca4cb></div><a class="VPLink link link" href="/fes.js/reference/plugin/plugins/swc.html" data-v-9b2ca4cb data-v-83901ecb><!--[--><p class="text" data-v-9b2ca4cb>@fesjs/plugin-swc</p><!--]--><!----></a><!----></div><!----></div><!--]--></div></section></div><div class="group" data-v-084bed16><section class="VPSidebarItem level-0" data-v-084bed16 data-v-9b2ca4cb><div class="item" role="button" tabindex="0" data-v-9b2ca4cb><div class="indicator" data-v-9b2ca4cb></div><h2 class="text" data-v-9b2ca4cb>插件开发</h2><!----></div><div class="items" data-v-9b2ca4cb><!--[--><div class="VPSidebarItem level-1 is-link" data-v-9b2ca4cb data-v-9b2ca4cb><div class="item" data-v-9b2ca4cb><div class="indicator" data-v-9b2ca4cb></div><a class="VPLink link link" href="/fes.js/reference/plugin/dev/index.html" data-v-9b2ca4cb data-v-83901ecb><!--[--><p class="text" data-v-9b2ca4cb>插件介绍</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-9b2ca4cb data-v-9b2ca4cb><div class="item" data-v-9b2ca4cb><div class="indicator" data-v-9b2ca4cb></div><a class="VPLink link link" href="/fes.js/reference/plugin/dev/api.html" data-v-9b2ca4cb data-v-83901ecb><!--[--><p class="text" data-v-9b2ca4cb>插件API</p><!--]--><!----></a><!----></div><!----></div><!--]--></div></section></div><!--]--><!--[--><!--]--></nav></aside><div class="VPContent has-sidebar" id="VPContent" data-v-d3edc1d3 data-v-7706de2c><div class="VPDoc has-sidebar has-aside" data-v-7706de2c data-v-6dc480e6><!--[--><!--]--><div class="container" data-v-6dc480e6><div class="aside" data-v-6dc480e6><div class="aside-curtain" data-v-6dc480e6></div><div class="aside-container" data-v-6dc480e6><div class="aside-content" data-v-6dc480e6><div class="VPDocAside" data-v-6dc480e6 data-v-0bcb2506><!--[--><!--]--><!--[--><!--]--><div class="VPDocAsideOutline" data-v-0bcb2506 data-v-9849bdbb><div class="content" data-v-9849bdbb><div class="outline-marker" data-v-9849bdbb></div><div class="outline-title" data-v-9849bdbb>本页目录</div><nav aria-labelledby="doc-outline-aria-label" data-v-9849bdbb><span class="visually-hidden" id="doc-outline-aria-label" data-v-9849bdbb> Table of Contents for current page </span><ul class="root" data-v-9849bdbb data-v-9b110da6><!--[--><!--]--></ul></nav></div></div><!--[--><!--]--><div class="spacer" data-v-0bcb2506></div><!--[--><!--]--><!----><!--[--><!--]--><!--[--><!--]--></div></div></div></div><div class="content" data-v-6dc480e6><div class="content-container" data-v-6dc480e6><!--[--><!--]--><!----><main class="main" data-v-6dc480e6><div style="position:relative;" class="vp-doc _fes_js_reference_plugin_plugins_jest" data-v-6dc480e6><div><h1 id="fesjs-plugin-jest" tabindex="-1">@fesjs/plugin-jest <a class="header-anchor" href="#fesjs-plugin-jest" aria-label="Permalink to &quot;@fesjs/plugin-jest&quot;"></a></h1><p>集成 <a href="https://www.jestjs.cn/" target="_blank" rel="noreferrer">Jest</a> 测试框架,目前只支持单元测试和覆盖测试。</p><h2 id="启用方式" tabindex="-1">启用方式 <a class="header-anchor" href="#启用方式" aria-label="Permalink to &quot;启用方式&quot;"></a></h2><p><code>package.json</code> 中引入依赖:</p><div class="language-json"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#89DDFF;">{</span></span>
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C792EA;">dependencies</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">{</span></span>
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#FFCB6B;">@fesjs/fes</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">^3.0.0</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">,</span></span>
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#FFCB6B;">@fesjs/plugin-jest</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">^3.0.0</span><span style="color:#89DDFF;">&quot;</span></span>
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">}</span></span>
<span class="line"><span style="color:#89DDFF;">}</span></span></code></pre></div><h2 id="约定" tabindex="-1">约定 <a class="header-anchor" href="#约定" aria-label="Permalink to &quot;约定&quot;"></a></h2><ul><li>项目根目录下 <code>tests</code><code>__tests__</code> 文件夹中的 <code>js</code> 或者 <code>jsx</code> 文件为测试文件。</li><li>需要覆盖测试的文件范围是<code>src/index.{js,jsx,ts,tsx,vue}</code></li></ul><p>例如测试文件 <code>add.js</code></p><div class="language-"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#A6ACCD;">fes-template</span></span>
<span class="line"><span style="color:#A6ACCD;">├── __tests__</span></span>
<span class="line"><span style="color:#A6ACCD;">│ └── add.js</span></span>
<span class="line"><span style="color:#A6ACCD;">└── src</span></span>
<span class="line"><span style="color:#A6ACCD;"> ├── .fes</span></span>
<span class="line"><span style="color:#A6ACCD;"> └── utils</span></span>
<span class="line"><span style="color:#A6ACCD;"> └── sum.js</span></span></code></pre></div><p>内容如下:</p><div class="language-js"><button title="Copy Code" class="copy"></button><span class="lang">js</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#89DDFF;font-style:italic;">import</span><span style="color:#A6ACCD;"> sum </span><span style="color:#89DDFF;font-style:italic;">from</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&#39;</span><span style="color:#C3E88D;">@/utils/sum</span><span style="color:#89DDFF;">&#39;</span><span style="color:#89DDFF;">;</span></span>
<span class="line"><span style="color:#82AAFF;">test</span><span style="color:#A6ACCD;">(</span><span style="color:#89DDFF;">&#39;</span><span style="color:#C3E88D;">adds 1 + 2 to equal 3</span><span style="color:#89DDFF;">&#39;</span><span style="color:#89DDFF;">,</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">()</span><span style="color:#A6ACCD;"> </span><span style="color:#C792EA;">=&gt;</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">{</span></span>
<span class="line"><span style="color:#F07178;"> </span><span style="color:#82AAFF;">expect</span><span style="color:#F07178;">(</span><span style="color:#82AAFF;">sum</span><span style="color:#F07178;">(</span><span style="color:#F78C6C;">1</span><span style="color:#89DDFF;">,</span><span style="color:#F07178;"> </span><span style="color:#F78C6C;">2</span><span style="color:#F07178;">))</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">toBe</span><span style="color:#F07178;">(</span><span style="color:#F78C6C;">3</span><span style="color:#F07178;">)</span><span style="color:#89DDFF;">;</span></span>
<span class="line"><span style="color:#89DDFF;">}</span><span style="color:#A6ACCD;">)</span><span style="color:#89DDFF;">;</span></span></code></pre></div><h2 id="命令" tabindex="-1">命令 <a class="header-anchor" href="#命令" aria-label="Permalink to &quot;命令&quot;"></a></h2><p><code>fes</code> 上注册 <code>test</code> 命令:</p><div class="language-bash"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#FFCB6B;">$</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">fes</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">test</span></span></code></pre></div><h2 id="配置" tabindex="-1">配置 <a class="header-anchor" href="#配置" aria-label="Permalink to &quot;配置&quot;"></a></h2><p>插件实现 Jest 的全部配置,具体请查看 <a href="https://www.jestjs.cn/docs/configuration#reference" target="_blank" rel="noreferrer">文档-configuration</a>。 也可以使用 <code>-h</code> 打印配置帮助信息:</p><h3 id="args-变量" tabindex="-1">args 变量 <a class="header-anchor" href="#args-变量" aria-label="Permalink to &quot;args 变量&quot;"></a></h3><div class="language-bash"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#FFCB6B;">$</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">fes</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">test</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-h</span></span></code></pre></div><p>打印配置帮助信息:</p><div class="language-"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki material-theme-palenight has-diff"><code><span class="line"><span style="color:#A6ACCD;">$ fes test -h</span></span>
<span class="line"><span style="color:#A6ACCD;">Usage: fes test [options]</span></span>
<span class="line"><span style="color:#A6ACCD;"></span></span>
<span class="line"><span style="color:#A6ACCD;">run unit tests with jest</span></span>
<span class="line"><span style="color:#A6ACCD;"></span></span>
<span class="line"><span style="color:#A6ACCD;">Options:</span></span>
<span class="line"><span style="color:#A6ACCD;"> --all The opposite of `onlyChanged`. If `onlyChanged`</span></span>
<span class="line"><span style="color:#A6ACCD;"> is set by default, running jest with `--all`</span></span>
<span class="line"><span style="color:#A6ACCD;"> will force Jest to run all tests instead of</span></span>
<span class="line"><span style="color:#A6ACCD;"> running only tests related to changed files.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --automock Automock all files by default.</span></span>
<span class="line"><span style="color:#A6ACCD;"> -b --bail Exit the test suite immediately after `n`</span></span>
<span class="line"><span style="color:#A6ACCD;"> number of failing tests.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --browser Respect the &quot;browser&quot; field in package.json</span></span>
<span class="line"><span style="color:#A6ACCD;"> when resolving modules. Some packages export</span></span>
<span class="line"><span style="color:#A6ACCD;"> different versions based on whether they are</span></span>
<span class="line"><span style="color:#A6ACCD;"> operating in node.js or a browser.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --cache Whether to use the transform cache. Disable the</span></span>
<span class="line"><span style="color:#A6ACCD;"> cache using --no-cache.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --cacheDirectory The directory where Jest should store its</span></span>
<span class="line"><span style="color:#A6ACCD;"> cached dependency information.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --changedFilesWithAncestor Runs tests related to the current changes and</span></span>
<span class="line"><span style="color:#A6ACCD;"> the changes made in the last commit. Behaves</span></span>
<span class="line"><span style="color:#A6ACCD;"> similarly to `--onlyChanged`.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --changedSince Runs tests related to the changes since the</span></span>
<span class="line"><span style="color:#A6ACCD;"> provided branch. If the current branch has</span></span>
<span class="line"><span style="color:#A6ACCD;"> diverged from the given branch, then only</span></span>
<span class="line"><span style="color:#A6ACCD;"> changes made locally will be tested. Behaves</span></span>
<span class="line"><span style="color:#A6ACCD;"> similarly to `--onlyChanged`.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --ci Whether to run Jest in continuous integration</span></span>
<span class="line"><span style="color:#A6ACCD;"> (CI) mode. This option is on by default in most</span></span>
<span class="line"><span style="color:#A6ACCD;"> popular CI environments. It will prevent</span></span>
<span class="line"><span style="color:#A6ACCD;"> snapshots from being written unless explicitly</span></span>
<span class="line"><span style="color:#A6ACCD;"> requested.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --clearCache Clears the configured Jest cache directory and</span></span>
<span class="line"><span style="color:#A6ACCD;"> then exits. Default directory can be found by</span></span>
<span class="line"><span style="color:#A6ACCD;"> calling jest --showConfig</span></span>
<span class="line"><span style="color:#A6ACCD;"> --clearMocks Automatically clear mock calls and instances</span></span>
<span class="line"><span style="color:#A6ACCD;"> between every test. Equivalent to calling</span></span>
<span class="line"><span style="color:#A6ACCD;"> jest.clearAllMocks() between each test.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --collectCoverage Alias for --coverage.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --collectCoverageFrom A glob pattern relative to &lt;rootDir&gt; matching</span></span>
<span class="line"><span style="color:#A6ACCD;"> the files that coverage info needs to be</span></span>
<span class="line"><span style="color:#A6ACCD;"> collected from.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --collectCoverageOnlyFrom Explicit list of paths coverage will be</span></span>
<span class="line"><span style="color:#A6ACCD;"> restricted to.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --color Forces test results output color highlighting</span></span>
<span class="line"><span style="color:#A6ACCD;"> (even if stdout is not a TTY). Set to false if</span></span>
<span class="line"><span style="color:#A6ACCD;"> you would like to have no colors.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --colors Alias for `--color`.</span></span>
<span class="line"><span style="color:#A6ACCD;"> -c --config The path to a jest config file specifying how</span></span>
<span class="line"><span style="color:#A6ACCD;"> to find and execute tests. If no rootDir is set</span></span>
<span class="line"><span style="color:#A6ACCD;"> in the config, the directory containing the</span></span>
<span class="line"><span style="color:#A6ACCD;"> config file is assumed to be the rootDir for</span></span>
<span class="line"><span style="color:#A6ACCD;"> the project.This can also be a JSON encoded</span></span>
<span class="line"><span style="color:#A6ACCD;"> value which Jest will use as configuration.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --coverage Indicates that test coverage information should</span></span>
<span class="line"><span style="color:#A6ACCD;"> be collected and reported in the output.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --coverageDirectory The directory where Jest should output its</span></span>
<span class="line"><span style="color:#A6ACCD;"> coverage files.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --coveragePathIgnorePatterns An array of regexp pattern strings that are</span></span>
<span class="line"><span style="color:#A6ACCD;"> matched against all file paths before executing</span></span>
<span class="line"><span style="color:#A6ACCD;"> the test. If the file pathmatches any of the</span></span>
<span class="line"><span style="color:#A6ACCD;"> patterns, coverage information will be skipped.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --coverageProvider Select between Babel and V8 to collect coverage</span></span>
<span class="line"><span style="color:#A6ACCD;"> --coverageReporters A list of reporter names that Jest uses when</span></span>
<span class="line"><span style="color:#A6ACCD;"> writing coverage reports. Any istanbul reporter</span></span>
<span class="line"><span style="color:#A6ACCD;"> can be used.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --coverageThreshold A JSON string with which will be used to</span></span>
<span class="line"><span style="color:#A6ACCD;"> configure minimum threshold enforcement for</span></span>
<span class="line"><span style="color:#A6ACCD;"> coverage results</span></span>
<span class="line"><span style="color:#A6ACCD;"> --debug Print debugging info about your jest config.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --detectLeaks **EXPERIMENTAL**: Detect memory leaks in tests.</span></span>
<span class="line"><span style="color:#A6ACCD;"> After executing a test, it will try to garbage</span></span>
<span class="line"><span style="color:#A6ACCD;"> collect the global object used, and fail if it</span></span>
<span class="line"><span style="color:#A6ACCD;"> was leaked</span></span>
<span class="line"><span style="color:#A6ACCD;"> --detectOpenHandles Print out remaining open handles preventing</span></span>
<span class="line"><span style="color:#A6ACCD;"> Jest from exiting at the end of a test run.</span></span>
<span class="line"><span style="color:#A6ACCD;"> Implies `runInBand`.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --env The test environment used for all tests. This</span></span>
<span class="line"><span style="color:#A6ACCD;"> can point to any file or node module. Examples:</span></span>
<span class="line"><span style="color:#A6ACCD;"> `jsdom`, `node` or `path/to/my-environment.js`</span></span>
<span class="line"><span style="color:#A6ACCD;"> --errorOnDeprecated Make calling deprecated APIs throw helpful</span></span>
<span class="line"><span style="color:#A6ACCD;"> error messages.</span></span>
<span class="line"><span style="color:#A6ACCD;"> -e --expand Use this flag to show full diffs instead of a</span></span>
<span class="line"><span style="color:#A6ACCD;"> patch.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --filter Path to a module exporting a filtering</span></span>
<span class="line"><span style="color:#A6ACCD;"> function. This method receives a list of tests</span></span>
<span class="line"><span style="color:#A6ACCD;"> which can be manipulated to exclude tests from</span></span>
<span class="line"><span style="color:#A6ACCD;"> running. Especially useful when used in</span></span>
<span class="line"><span style="color:#A6ACCD;"> conjunction with a testing infrastructure to</span></span>
<span class="line"><span style="color:#A6ACCD;"> filter known broken tests.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --findRelatedTests Find related tests for a list of source files</span></span>
<span class="line"><span style="color:#A6ACCD;"> that were passed in as arguments. Useful for</span></span>
<span class="line"><span style="color:#A6ACCD;"> pre-commit hook integration to run the minimal</span></span>
<span class="line"><span style="color:#A6ACCD;"> amount of tests necessary.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --forceExit Force Jest to exit after all tests have</span></span>
<span class="line"><span style="color:#A6ACCD;"> completed running. This is useful when</span></span>
<span class="line"><span style="color:#A6ACCD;"> resources set up by test code cannot be</span></span>
<span class="line"><span style="color:#A6ACCD;"> adequately cleaned up.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --globalSetup The path to a module that runs before All</span></span>
<span class="line"><span style="color:#A6ACCD;"> Tests.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --globalTeardown The path to a module that runs after All Tests.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --globals A JSON string with map of global variables that</span></span>
<span class="line"><span style="color:#A6ACCD;"> need to be available in all test environments.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --haste A JSON string with map of variables for the</span></span>
<span class="line"><span style="color:#A6ACCD;"> haste module system</span></span>
<span class="line"><span style="color:#A6ACCD;"> --init Generate a basic configuration file</span></span>
<span class="line"><span style="color:#A6ACCD;"> --injectGlobals Should Jest inject global variables or not</span></span>
<span class="line"><span style="color:#A6ACCD;"> --json Prints the test results in JSON. This mode will</span></span>
<span class="line"><span style="color:#A6ACCD;"> send all other test output and user messages to</span></span>
<span class="line"><span style="color:#A6ACCD;"> stderr.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --lastCommit Run all tests affected by file changes in the</span></span>
<span class="line"><span style="color:#A6ACCD;"> last commit made. Behaves similarly to</span></span>
<span class="line"><span style="color:#A6ACCD;"> `--onlyChanged`.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --listTests Lists all tests Jest will run given the</span></span>
<span class="line"><span style="color:#A6ACCD;"> arguments and exits. Most useful in a CI system</span></span>
<span class="line"><span style="color:#A6ACCD;"> together with `--findRelatedTests` to determine</span></span>
<span class="line"><span style="color:#A6ACCD;"> the tests Jest will run based on specific files</span></span>
<span class="line"><span style="color:#A6ACCD;"> --logHeapUsage Logs the heap usage after every test. Useful to</span></span>
<span class="line"><span style="color:#A6ACCD;"> debug memory leaks. Use together with</span></span>
<span class="line"><span style="color:#A6ACCD;"> `--runInBand` and `--expose-gc` in node.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --mapCoverage Maps code coverage reports against original source code when transformers supply source maps.</span></span>
<span class="line"><span style="color:#A6ACCD;"></span></span>
<span class="line"><span style="color:#A6ACCD;"> DEPRECATED</span></span>
<span class="line"><span style="color:#A6ACCD;"> --maxConcurrency Specifies the maximum number of tests that are</span></span>
<span class="line"><span style="color:#A6ACCD;"> allowed to runconcurrently. This only affects</span></span>
<span class="line"><span style="color:#A6ACCD;"> tests using `test.concurrent`.</span></span>
<span class="line"><span style="color:#A6ACCD;"> -w --maxWorkers Specifies the maximum number of workers the</span></span>
<span class="line"><span style="color:#A6ACCD;"> worker-pool will spawn for running tests. This</span></span>
<span class="line"><span style="color:#A6ACCD;"> defaults to the number of the cores available</span></span>
<span class="line"><span style="color:#A6ACCD;"> on your machine. (its usually best not to</span></span>
<span class="line"><span style="color:#A6ACCD;"> override this default)</span></span>
<span class="line"><span style="color:#A6ACCD;"> --moduleDirectories An array of directory names to be searched</span></span>
<span class="line"><span style="color:#A6ACCD;"> recursively up from the requiring module&#39;s</span></span>
<span class="line"><span style="color:#A6ACCD;"> location.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --moduleFileExtensions An array of file extensions your modules use.</span></span>
<span class="line"><span style="color:#A6ACCD;"> If you require modules without specifying a</span></span>
<span class="line"><span style="color:#A6ACCD;"> file extension, these are the extensions Jest</span></span>
<span class="line"><span style="color:#A6ACCD;"> will look for.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --moduleNameMapper A JSON string with a map from regular</span></span>
<span class="line"><span style="color:#A6ACCD;"> expressions to module names or to arrays of</span></span>
<span class="line"><span style="color:#A6ACCD;"> module names that allow to stub out resources,</span></span>
<span class="line"><span style="color:#A6ACCD;"> like images or styles with a single module</span></span>
<span class="line"><span style="color:#A6ACCD;"> --modulePathIgnorePatterns An array of regexp pattern strings that are</span></span>
<span class="line"><span style="color:#A6ACCD;"> matched against all module paths before those</span></span>
<span class="line"><span style="color:#A6ACCD;"> paths are to be considered &quot;visible&quot; to the</span></span>
<span class="line"><span style="color:#A6ACCD;"> module loader.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --modulePaths An alternative API to setting the NODE_PATH env</span></span>
<span class="line"><span style="color:#A6ACCD;"> variable, modulePaths is an array of absolute</span></span>
<span class="line"><span style="color:#A6ACCD;"> paths to additional locations to search when</span></span>
<span class="line"><span style="color:#A6ACCD;"> resolving modules.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --noStackTrace Disables stack trace in test results output</span></span>
<span class="line"><span style="color:#A6ACCD;"> --notify Activates notifications for test results.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --notifyMode Specifies when notifications will appear for</span></span>
<span class="line"><span style="color:#A6ACCD;"> test results.</span></span>
<span class="line"><span style="color:#A6ACCD;"> -o --onlyChanged Attempts to identify which tests to run based</span></span>
<span class="line"><span style="color:#A6ACCD;"> on which files have changed in the current</span></span>
<span class="line"><span style="color:#A6ACCD;"> repository. Only works if you&#39;re running tests</span></span>
<span class="line"><span style="color:#A6ACCD;"> in a git or hg repository at the moment.</span></span>
<span class="line"><span style="color:#A6ACCD;"> -f --onlyFailures Run tests that failed in the previous</span></span>
<span class="line"><span style="color:#A6ACCD;"> execution.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --outputFile Write test results to a file when the --json</span></span>
<span class="line"><span style="color:#A6ACCD;"> option is also specified.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --passWithNoTests Will not fail if no tests are found (for</span></span>
<span class="line"><span style="color:#A6ACCD;"> example while using `--testPathPattern`.)</span></span>
<span class="line"><span style="color:#A6ACCD;"> --preset A preset that is used as a base for Jest&#39;s</span></span>
<span class="line"><span style="color:#A6ACCD;"> configuration.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --prettierPath The path to the &quot;prettier&quot; module used for</span></span>
<span class="line"><span style="color:#A6ACCD;"> inline snapshots.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --projects A list of projects that use Jest to run all</span></span>
<span class="line"><span style="color:#A6ACCD;"> tests of all projects in a single instance of</span></span>
<span class="line"><span style="color:#A6ACCD;"> Jest.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --reporters A list of custom reporters for the test suite.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --resetMocks Automatically reset mock state between every</span></span>
<span class="line"><span style="color:#A6ACCD;"> test. Equivalent to calling</span></span>
<span class="line"><span style="color:#A6ACCD;"> jest.resetAllMocks() between each test.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --resetModules If enabled, the module registry for every test</span></span>
<span class="line"><span style="color:#A6ACCD;"> file will be reset before running each</span></span>
<span class="line"><span style="color:#A6ACCD;"> individual test.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --resolver A JSON string which allows the use of a custom</span></span>
<span class="line"><span style="color:#A6ACCD;"> resolver.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --restoreMocks Automatically restore mock state and</span></span>
<span class="line"><span style="color:#A6ACCD;"> implementation between every test. Equivalent</span></span>
<span class="line"><span style="color:#A6ACCD;"> to calling jest.restoreAllMocks() between each</span></span>
<span class="line"><span style="color:#A6ACCD;"> test.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --rootDir The root directory that Jest should scan for</span></span>
<span class="line"><span style="color:#A6ACCD;"> tests and modules within.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --roots A list of paths to directories that Jest should</span></span>
<span class="line"><span style="color:#A6ACCD;"> use to search for files in.</span></span>
<span class="line"><span style="color:#A6ACCD;"> -i --runInBand Run all tests serially in the current process</span></span>
<span class="line"><span style="color:#A6ACCD;"> (rather than creating a worker pool of child</span></span>
<span class="line"><span style="color:#A6ACCD;"> processes that run tests). This is sometimes</span></span>
<span class="line"><span style="color:#A6ACCD;"> useful for debugging, but such use cases are</span></span>
<span class="line"><span style="color:#A6ACCD;"> pretty rare.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --runTestsByPath Used when provided patterns are exact file</span></span>
<span class="line"><span style="color:#A6ACCD;"> paths. This avoids converting them into a</span></span>
<span class="line"><span style="color:#A6ACCD;"> regular expression and matching it against</span></span>
<span class="line"><span style="color:#A6ACCD;"> every single file.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --runner Allows to use a custom runner instead of Jest&#39;s</span></span>
<span class="line"><span style="color:#A6ACCD;"> default test runner.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --selectProjects Run only the tests of the specified</span></span>
<span class="line"><span style="color:#A6ACCD;"> projects.Jest uses the attribute `displayName`</span></span>
<span class="line"><span style="color:#A6ACCD;"> in the configuration to identify each project.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --setupFiles A list of paths to modules that run some code</span></span>
<span class="line"><span style="color:#A6ACCD;"> to configure or set up the testing environment</span></span>
<span class="line"><span style="color:#A6ACCD;"> before each test.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --setupFilesAfterEnv A list of paths to modules that run some code</span></span>
<span class="line"><span style="color:#A6ACCD;"> to configure or set up the testing framework</span></span>
<span class="line"><span style="color:#A6ACCD;"> before each test</span></span>
<span class="line"><span style="color:#A6ACCD;"> --showConfig Print your jest config and then exits.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --silent Prevent tests from printing messages through</span></span>
<span class="line"><span style="color:#A6ACCD;"> the console.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --skipFilter Disables the filter provided by --filter.</span></span>
<span class="line"><span style="color:#A6ACCD;"> Useful for CI jobs, or local enforcement when</span></span>
<span class="line"><span style="color:#A6ACCD;"> fixing tests.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --snapshotSerializers A list of paths to snapshot serializer modules</span></span>
<span class="line"><span style="color:#A6ACCD;"> Jest should use for snapshot testing.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --testEnvironment Alias for --env</span></span>
<span class="line"><span style="color:#A6ACCD;"> --testEnvironmentOptions Test environment options that will be passed to</span></span>
<span class="line"><span style="color:#A6ACCD;"> the testEnvironment. The relevant options</span></span>
<span class="line"><span style="color:#A6ACCD;"> depend on the environment.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --testFailureExitCode Exit code of `jest` command if the test run</span></span>
<span class="line"><span style="color:#A6ACCD;"> failed</span></span>
<span class="line"><span style="color:#A6ACCD;"> --testLocationInResults Add `location` information to the test results</span></span>
<span class="line"><span style="color:#A6ACCD;"> --testMatch The glob patterns Jest uses to detect test</span></span>
<span class="line"><span style="color:#A6ACCD;"> files.</span></span>
<span class="line"><span style="color:#A6ACCD;"> -t --testNamePattern Run only tests with a name that matches the</span></span>
<span class="line"><span style="color:#A6ACCD;"> regex pattern.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --testPathIgnorePatterns An array of regexp pattern strings that are</span></span>
<span class="line"><span style="color:#A6ACCD;"> matched against all test paths before executing</span></span>
<span class="line"><span style="color:#A6ACCD;"> the test. If the test path matches any of the</span></span>
<span class="line"><span style="color:#A6ACCD;"> patterns, it will be skipped.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --testPathPattern A regexp pattern string that is matched against</span></span>
<span class="line"><span style="color:#A6ACCD;"> all tests paths before executing the test.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --testRegex A string or array of string regexp patterns</span></span>
<span class="line"><span style="color:#A6ACCD;"> that Jest uses to detect test files.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --testResultsProcessor Allows the use of a custom results processor.</span></span>
<span class="line"><span style="color:#A6ACCD;"> This processor must be a node module that</span></span>
<span class="line"><span style="color:#A6ACCD;"> exports a function expecting as the first</span></span>
<span class="line"><span style="color:#A6ACCD;"> argument the result object.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --testRunner Allows to specify a custom test runner. The</span></span>
<span class="line"><span style="color:#A6ACCD;"> default is `jasmine2`. A path to a custom test</span></span>
<span class="line"><span style="color:#A6ACCD;"> runner can be provided:</span></span>
<span class="line"><span style="color:#A6ACCD;"> `&lt;rootDir&gt;/path/to/testRunner.js`.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --testSequencer Allows to specify a custom test sequencer. The</span></span>
<span class="line"><span style="color:#A6ACCD;"> default is `@jest/test-sequencer`. A path to a</span></span>
<span class="line"><span style="color:#A6ACCD;"> custom test sequencer can be provided:</span></span>
<span class="line"><span style="color:#A6ACCD;"> `&lt;rootDir&gt;/path/to/testSequencer.js`</span></span>
<span class="line"><span style="color:#A6ACCD;"> --testTimeout This option sets the default timeouts of test</span></span>
<span class="line"><span style="color:#A6ACCD;"> cases.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --testURL This option sets the URL for the jsdom</span></span>
<span class="line"><span style="color:#A6ACCD;"> environment.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --timers Setting this value to fake allows the use of</span></span>
<span class="line"><span style="color:#A6ACCD;"> fake timers for functions such as setTimeout.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --transform A JSON string which maps from regular</span></span>
<span class="line"><span style="color:#A6ACCD;"> expressions to paths to transformers.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --transformIgnorePatterns An array of regexp pattern strings that are</span></span>
<span class="line"><span style="color:#A6ACCD;"> matched against all source file paths before</span></span>
<span class="line"><span style="color:#A6ACCD;"> transformation.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --unmockedModulePathPatterns An array of regexp pattern strings that are</span></span>
<span class="line"><span style="color:#A6ACCD;"> matched against all modules before the module</span></span>
<span class="line"><span style="color:#A6ACCD;"> loader will automatically return a mock for</span></span>
<span class="line"><span style="color:#A6ACCD;"> them.</span></span>
<span class="line"><span style="color:#A6ACCD;"> -u --updateSnapshot Use this flag to re-record snapshots. Can be</span></span>
<span class="line"><span style="color:#A6ACCD;"> used together with a test suite pattern or with</span></span>
<span class="line"><span style="color:#A6ACCD;"> `--testNamePattern` to re-record snapshot for</span></span>
<span class="line"><span style="color:#A6ACCD;"> test matching the pattern</span></span>
<span class="line"><span style="color:#A6ACCD;"> --useStderr Divert all output to stderr.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --verbose Display individual test results with the test</span></span>
<span class="line"><span style="color:#A6ACCD;"> suite hierarchy.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --watch Watch files for changes and rerun tests related</span></span>
<span class="line"><span style="color:#A6ACCD;"> to changed files. If you want to re-run all</span></span>
<span class="line"><span style="color:#A6ACCD;"> tests when a file has changed, use the</span></span>
<span class="line"><span style="color:#A6ACCD;"> `--watchAll` option.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --watchAll Watch files for changes and rerun all tests. If</span></span>
<span class="line"><span style="color:#A6ACCD;"> you want to re-run only the tests related to</span></span>
<span class="line"><span style="color:#A6ACCD;"> the changed files, use the `--watch` option.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --watchPathIgnorePatterns An array of regexp pattern strings that are</span></span>
<span class="line"><span style="color:#A6ACCD;"> matched against all paths before trigger test</span></span>
<span class="line"><span style="color:#A6ACCD;"> re-run in watch mode. If the test path matches</span></span>
<span class="line"><span style="color:#A6ACCD;"> any of the patterns, it will be skipped.</span></span>
<span class="line"><span style="color:#A6ACCD;"> --watchman Whether to use watchman for file crawling.</span></span>
<span class="line"><span style="color:#A6ACCD;"> Disable using --no-watchman.</span></span>
<span class="line"><span style="color:#A6ACCD;"> -h, --help display help for command</span></span></code></pre></div><p>比如覆盖测试:</p><div class="language-"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#A6ACCD;">fes test --coverage</span></span></code></pre></div><h3 id="配置文件" tabindex="-1">配置文件 <a class="header-anchor" href="#配置文件" aria-label="Permalink to &quot;配置文件&quot;"></a></h3><p>除了插件内置的默认配置之外,插件遵循 <code>Jest</code>的配置文件规范,约定项目根目录下的 <code>jest.config.js</code> 为用户配置文件,约定 <code>packages.json</code><code>jest</code> 属性内容也是配置。</p><h3 id="优先级" tabindex="-1">优先级 <a class="header-anchor" href="#优先级" aria-label="Permalink to &quot;优先级&quot;"></a></h3><p><code>args</code> 配置 &gt; <code>package.json</code>中的 <code>jest</code> &gt; <code>jest.config.js</code> &gt; 默认配置</p></div></div></main><footer class="VPDocFooter" data-v-6dc480e6 data-v-30350303><!--[--><!--]--><!----><div class="prev-next" data-v-30350303><div class="pager" data-v-30350303><a class="pager-link prev" href="/fes.js/reference/plugin/plugins/icon.html" data-v-30350303><span class="desc" data-v-30350303>Previous page</span><span class="title" data-v-30350303>@fesjs/plugin-icon</span></a></div><div class="has-prev pager" data-v-30350303><a class="pager-link next" href="/fes.js/reference/plugin/plugins/layout.html" data-v-30350303><span class="desc" data-v-30350303>Next page</span><span class="title" data-v-30350303>@fesjs/plugin-layout</span></a></div></div></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><footer class="VPFooter has-sidebar" data-v-d3edc1d3 data-v-3bd6857d><div class="container" data-v-3bd6857d><p class="message" data-v-3bd6857d>Released under the MIT License.</p><p class="copyright" data-v-3bd6857d>Copyright © 2020-present Webank</p></div></footer><!--[--><!--]--></div></div>
<script>__VP_HASH_MAP__ = JSON.parse("{\"reference_plugin_index.md\":\"ff230c53\",\"guide_image.md\":\"68538628\",\"reference_plugin_dev_index.md\":\"eb394b31\",\"reference_plugin_plugins_editor.md\":\"e47cffc2\",\"guide_builder.md\":\"da64d858\",\"reference_plugin_plugins_locale.md\":\"f2ad7111\",\"guide_env.md\":\"524e7c55\",\"reference_plugin_plugins_windicss.md\":\"76a2f583\",\"reference_plugin_plugins_watermark.md\":\"ff5893bf\",\"guide_faq.md\":\"bcfd6a77\",\"reference_plugin_plugins_sass.md\":\"ad29d499\",\"reference_config_index.md\":\"d3e13751\",\"guide_css.md\":\"e9f5916f\",\"reference_api.md\":\"fb7e1612\",\"reference_plugin_plugins_icon.md\":\"8e1a0033\",\"reference_plugin_plugins_enums.md\":\"920bbaba\",\"guide_contributing.md\":\"1734fd0c\",\"index.md\":\"8e92f132\",\"reference_plugin_plugins_vuex.md\":\"0b177022\",\"guide_directory-structure.md\":\"b9d44484\",\"guide_public.md\":\"2615d6f5\",\"guide_template.md\":\"d4004323\",\"guide_index.md\":\"72257f62\",\"reference_plugin_plugins_pinia.md\":\"f23c8887\",\"reference_plugin_plugins_login.md\":\"50fc66a2\",\"guide_getting-started.md\":\"1a6721fe\",\"reference_plugin_plugins_model.md\":\"0ebb79f4\",\"guide_upgrade3.md\":\"aa1339b5\",\"guide_plugin.md\":\"bcd330ad\",\"reference_plugin_plugins_qiankun.md\":\"a2eacef5\",\"reference_plugin_plugins_access.md\":\"4e4ed6f5\",\"guide_runtime-config.md\":\"99433914\",\"reference_plugin_dev_api.md\":\"b4efeb0f\",\"guide_route.md\":\"bc8f1b03\",\"reference_plugin_plugins_layout.md\":\"c5c38247\",\"reference_plugin_plugins_request-4.md\":\"ab5eb474\",\"reference_cli_index.md\":\"071789d9\",\"guide_mock.md\":\"1451d115\",\"reference_plugin_plugins_jest.md\":\"4b1c2ebf\",\"guide_config.md\":\"25bc06f2\",\"reference_api_index.md\":\"9ffa99a5\",\"reference_plugin_plugins_swc.md\":\"b42a6e35\",\"reference_plugin_plugins_request.md\":\"6bcdc264\"}")
__VP_SITE_DATA__ = JSON.parse("{\"lang\":\"en-US\",\"dir\":\"ltr\",\"title\":\"Fes.js\",\"description\":\"一个好用的前端应用解决方案\",\"base\":\"/fes.js/\",\"head\":[],\"appearance\":true,\"themeConfig\":{\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/WeBankFinTech/fes.js\"}],\"logo\":\"/logo.png\",\"nav\":[{\"text\":\"指南\",\"link\":\"/guide/\",\"activeMatch\":\"/guide/\"},{\"text\":\"编译时配置\",\"link\":\"/reference/config/\"},{\"text\":\"API\",\"link\":\"/reference/api/\"},{\"text\":\"插件\",\"link\":\"/reference/plugin/\",\"activeMatch\":\"/plugin/\"},{\"text\":\"CLI\",\"link\":\"/reference/cli/index.md\"},{\"text\":\"v3.1.1\",\"items\":[{\"text\":\"v2.0\",\"link\":\"https://fesjs.mumblefe.cn/2.0/\"},{\"text\":\"v1.0\",\"link\":\"https://fesjs.mumblefe.cn/1.0/\"}]},{\"text\":\"了解更多\",\"items\":[{\"text\":\"更新日志\",\"link\":\"https://github.com/WeBankFinTech/fes.js/blob/master/CHANGELOG.md\"},{\"text\":\"fes-design\",\"link\":\"http://fes-design.mumblefe.cn/\"}]}],\"sidebar\":{\"/guide/\":[{\"text\":\"开始\",\"items\":[{\"text\":\"介绍\",\"link\":\"/guide/index.md\"},{\"text\":\"快速上手\",\"link\":\"/guide/getting-started.md\"}]},{\"text\":\"基础\",\"items\":[{\"text\":\"目录结构\",\"link\":\"/guide/directory-structure.md\"},{\"text\":\"Vite 和 Webpack 双构建\",\"link\":\"/guide/builder.md\"},{\"text\":\"编译时配置\",\"link\":\"/guide/config.md\"},{\"text\":\"运行时配置\",\"link\":\"/guide/runtime-config.md\"},{\"text\":\"环境变量\",\"link\":\"/guide/env.md\"},{\"text\":\"路由\",\"link\":\"/guide/route.md\"},{\"text\":\"插件\",\"link\":\"/guide/plugin.md\"},{\"text\":\"HTML 模板\",\"link\":\"/guide/template.md\"},{\"text\":\"Mock 数据\",\"link\":\"/guide/mock.md\"},{\"text\":\"从 2.0.x 迁移到 3.0.x\",\"link\":\"/guide/upgrade3.md\"}]},{\"text\":\"样式和资源文件\",\"items\":[{\"text\":\"使用图片\",\"link\":\"/guide/image.md\"},{\"text\":\"使用 css\",\"link\":\"/guide/css.md\"},{\"text\":\"静态资源\",\"link\":\"/guide/public.md\"}]},{\"text\":\"贡献指南\",\"link\":\"/guide/contributing.md\"},{\"text\":\"常见问题\",\"link\":\"/guide/faq.md\"}],\"/reference/plugin/\":[{\"text\":\"介绍\",\"link\":\"/reference/plugin/index.md\"},{\"text\":\"Plugins\",\"items\":[{\"text\":\"@fesjs/plugin-access\",\"link\":\"/reference/plugin/plugins/access.md\"},{\"text\":\"@fesjs/plugin-enums\",\"link\":\"/reference/plugin/plugins/enums.md\"},{\"text\":\"@fesjs/plugin-icon\",\"link\":\"/reference/plugin/plugins/icon.md\"},{\"text\":\"@fesjs/plugin-jest\",\"link\":\"/reference/plugin/plugins/jest.md\"},{\"text\":\"@fesjs/plugin-layout\",\"link\":\"/reference/plugin/plugins/layout.md\"},{\"text\":\"@fesjs/plugin-locale\",\"link\":\"/reference/plugin/plugins/locale.md\"},{\"text\":\"@fesjs/plugin-model\",\"link\":\"/reference/plugin/plugins/model.md\"},{\"text\":\"@fesjs/plugin-request\",\"link\":\"/reference/plugin/plugins/request.md\"},{\"text\":\"@fesjs/plugin-vuex\",\"link\":\"/reference/plugin/plugins/vuex.md\"},{\"text\":\"@fesjs/plugin-qiankun\",\"link\":\"/reference/plugin/plugins/qiankun.md\"},{\"text\":\"@fesjs/plugin-windicss\",\"link\":\"/reference/plugin/plugins/windicss.md\"},{\"text\":\"@fesjs/plugin-sass\",\"link\":\"/reference/plugin/plugins/sass.md\"},{\"text\":\"@fesjs/plugin-editor\",\"link\":\"/reference/plugin/plugins/editor.md\"},{\"text\":\"@fesjs/plugin-pinia\",\"link\":\"/reference/plugin/plugins/pinia.md\"},{\"text\":\"@fesjs/plugin-watermark\",\"link\":\"/reference/plugin/plugins/watermark.md\"},{\"text\":\"@fesjs/plugin-login\",\"link\":\"/reference/plugin/plugins/login.md\"},{\"text\":\"@fesjs/plugin-swc\",\"link\":\"/reference/plugin/plugins/swc.md\"}]},{\"text\":\"插件开发\",\"items\":[{\"text\":\"插件介绍\",\"link\":\"/reference/plugin/dev/index.md\"},{\"text\":\"插件API\",\"link\":\"/reference/plugin/dev/api.md\"}]}]},\"outline\":{\"label\":\"本页目录\"},\"search\":{\"provider\":\"local\"},\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2020-present Webank\"}},\"locales\":{},\"scrollOffset\":90,\"cleanUrls\":false}")</script>
</body>
</html>