21
我在我的測試組中有兩個測試。一個人使用它,另一個使用測試,他們似乎工作非常類似。他們有什麼區別?笑話中'it'和'test'有什麼區別?
describe('updateAll',() => {
it('no force',() => {
return updateAll(TableName, ["fileName"], {compandId: "test"})
.then(updatedItems => {
let undefinedCount = 0;
for (let item of updatedItems) {
undefinedCount += item === undefined ? 1 : 0;
}
// console.log("result", result);
expect(undefinedCount).toBe(updatedItems.length);
})
});
test('force update',() => {
return updateAll(TableName, ["fileName"], {compandId: "test"}, true)
.then(updatedItems => {
let undefinedCount = 0;
for (let item of updatedItems) {
undefinedCount += item === undefined ? 1 : 0;
}
// console.log("result", result);
expect(undefinedCount).toBe(0);
})
});
});
UPDATE:
似乎test
是the official API of Jest,但it
不是。
'它'可能只是在那裏熟悉和從其他框架遷移。 – Li357
沒有區別。該文檔明確指出'test'在別名'it'下面。 – Claies
@Claies謝謝,我沒有看到。請把它作爲答案。 –