मेरे परीक्षण समूह में मेरे दो परीक्षण हैं। एक परीक्षण का उपयोग करता है, और वे बहुत समान रूप से काम करने लगते हैं। उनके बीच क्या अंतर है?
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
में है जेस्ट की आधिकारिक एपीआई , लेकिन it
नहीं है।
test
से उपनाम के तहत है it
।
it
बस अन्य चौखटों से परिचित और प्रवास के लिए हो सकता है।