21
私のテストグループには2つのテストがあります。 1つはそれを使用し、もう1つはテストを使用し、それらは非常に同様に動作しているようです。それらの違いは何ですか?冗談で 'それ'と 'テスト'の違いは何ですか?
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ありがとう、私はそれを見ていませんでした。それを答えにしてください。 –