{ // your test code here }..."/>
您好,登錄后才能下訂單哦!
在 Jest 中,要跳過特定測(cè)試,可以使用 test.skip()
方法
例如,假設(shè)您有以下測(cè)試:
test('this test will run', () => {
// your test code here
});
test('this test will be skipped', () => {
// your test code here
});
要跳過第二個(gè)測(cè)試,只需將其更改為:
test('this test will run', () => {
// your test code here
});
test.skip('this test will be skipped', () => {
// your test code here
});
現(xiàn)在,當(dāng)您運(yùn)行測(cè)試時(shí),第二個(gè)測(cè)試將被跳過。請(qǐng)注意,test.skip()
也可以與 describe
結(jié)構(gòu)一起使用,以跳過整個(gè)測(cè)試套件。
describe('skipped suite', () => {
test('this test will be skipped', () => {
// your test code here
});
test('this test will also be skipped', () => {
// your test code here
});
}).skip();
這將跳過整個(gè)“skipped suite”中的所有測(cè)試。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。