gpt4 book ai didi

reactjs - describe(it()) 和 describe(test()) 的区别

转载 作者:行者123 更新时间:2023-11-28 20:27:35 29 4
gpt4 key购买 nike

我看过很多ReactJS中测试的例子都用it()

示例:

describe('General behaviour', () => {
it('should call toggle() when clicked', () => {
// expect something
});

我看到了开 Jest 使用 test() 的例子

例子:

describe('matching cities to foods', () => {
test('Vienna <3 sausage', () => {
expect(isValidCityFoodPair('Vienna', 'Wiener Schnitzel')).toBe(true);
});

see more jest for react example in this link .

它们有什么不同?

最佳答案

就是test aliased.

来自 Jasmine 和其他测试框架的人使用 `it。

关于reactjs - describe(it()) 和 describe(test()) 的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49186043/

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