cjlalalala
V2EX  ›  问与答

jest 问题

  •  
  •   cjlalalala · May 31, 2023 · 1100 views
    This topic created in 1078 days ago, the information mentioned may be changed or developed.
    请教一下各位大哥,我有个目录结构如下
    core
    |__src
    |__test

    我想把 jest 的 jest.config.json 放在 test 目录下,该目录专门有个 package.json 用来下来 jest 相关的依赖并且有单独封装了测试相关的命令在 scripts 字段中。

    但是我在 testMatch 字段中根据相对路径想去 match src 目录的测试文件时,老是说 zero match 。我的 testMatch 声明如下:"testMatch": ["../src/**/*.spec.(js|jsx|ts|tsx)"],

    请问应该如何实现,才能实现我想达到的效果?
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4478 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 65ms · UTC 10:08 · PVG 18:08 · LAX 03:08 · JFK 06:08
    ♥ Do have faith in what you're doing.