cjlalalala
V2EX  ›  问与答

jest 问题

  •  
  •   cjlalalala · May 31, 2023 · 1157 views
    This topic created in 1108 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   ·   1243 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 17:47 · PVG 01:47 · LAX 10:47 · JFK 13:47
    ♥ Do have faith in what you're doing.