gpt4 book ai didi

node.js - 如何在不使用 Jest 测试运行器的情况下使用 Jest 的断言库?

转载 作者:搜寻专家 更新时间:2023-10-31 23:51:45 25 4
gpt4 key购买 nike

Jest创建这个名为 expect 的全局.我如何使用他们的测试运行器?即,我必须导入/要求什么?

最佳答案

该模块简称为expect

例如

import expect from 'expect'

expect(1 + 1).toBe(2)

您可以在 Jest lerna repo 中看到它和 individual package on npm

关于node.js - 如何在不使用 Jest 测试运行器的情况下使用 Jest 的断言库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43076758/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com