У мене в тестовій групі два тести. Один використовує його, інший використовує тест, і вони, схоже, працюють дуже аналогічно. У чому різниця між ними?
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);
})
});
});
ОНОВЛЕННЯ:
Здається, це testє в офіційному API Jest , але itце не так.
testзнаходиться під псевдонімом it.
itможливо, просто знайдеться там для знайомства та міграції з інших рамок.