Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(tests): replace silent return exits with explicit Mocha skip calls (#17989)

Aarav Anand96a5d3333b8a
diff --git a/tests/specs/jaas/recording.spec.ts b/tests/specs/jaas/recording.spec.ts
index 822875731f..7dd8ab4204 100644
--- a/tests/specs/jaas/recording.spec.ts
+++ b/tests/specs/jaas/recording.spec.ts
@@ -174,9 +174,10 @@ describe('Recording and live-streaming', () => {
await p.getIframeAPI().clearEventResults('recordingStatusChanged');
}
- it('start/stop recording using the iFrame command', async () => {
+ it('start/stop recording using the iFrame command', async function() {
if (!recordingEnabled) {
- return;
+ // eslint-disable-next-line @typescript-eslint/no-invalid-this
+ this.skip();
}
await startRecording(true);
@@ -186,9 +187,10 @@ describe('Recording and live-streaming', () => {
await p.driver.pause(30000);
});
- it('start/stop recording using the iFrame function', async () => {
+ it('start/stop recording using the iFrame function', async function() {
if (!recordingEnabled) {
- return;
+ // eslint-disable-next-line @typescript-eslint/no-invalid-this
+ this.skip();
}
await startRecording(false);
@@ -198,9 +200,10 @@ describe('Recording and live-streaming', () => {
await p.driver.pause(30000);
});
- it('start/stop live-streaming using the iFrame command', async () => {
+ it('start/stop live-streaming using the iFrame command', async function() {
if (!liveStreamingEnabled) {
- return;
+ // eslint-disable-next-line @typescript-eslint/no-invalid-this
+ this.skip();
}
await p.getIframeAPI().addEventListener('recordingStatusChanged');
diff --git a/tests/specs/media/audioVideoModeration.spec.ts b/tests/specs/media/audioVideoModeration.spec.ts
index 9278371eac..4ed101ced5 100644
--- a/tests/specs/media/audioVideoModeration.spec.ts
+++ b/tests/specs/media/audioVideoModeration.spec.ts
@@ -82,11 +82,12 @@ describe('Audio/video moderation', () => {
await p2.getFilmstrip().assertAudioMuteIconIsDisplayed(p2, true);
});
- it('hangup and change moderator', async () => {
+ it('hangup and change moderator', async function() {
// The test below is only correct when the environment is configured to automatically elect a new moderator
// when the moderator leaves. For environments where this is not the case, the test is skipped.
if (!expectations.autoModerator) {
- return;
+ // eslint-disable-next-line @typescript-eslint/no-invalid-this
+ this.skip();
}
await Promise.all([ ctx.p2.hangup(), ctx.p3.hangup() ]);
diff --git a/tests/specs/misc/avatars.spec.ts b/tests/specs/misc/avatars.spec.ts
index 490d820041..425b163a58 100644
--- a/tests/specs/misc/avatars.spec.ts
+++ b/tests/specs/misc/avatars.spec.ts
@@ -187,13 +187,14 @@ describe('Avatar', () => {
await unmuteVideoAndCheck(p1, p2);
});
- it('email persistence', async () => {
+ it('email persistence', async function() {
let { p1 } = ctx;
if (p1.driver.isFirefox) {
// strangely this test when FF is involved, missing source mapping from jvb
// and fails with an error of: expected number of remote streams:1 in 15s for participant1
- return;
+ // eslint-disable-next-line @typescript-eslint/no-invalid-this
+ this.skip();
}
await p1.getToolbar().clickProfileButton();
diff --git a/tests/specs/misc/dialIn.spec.ts b/tests/specs/misc/dialIn.spec.ts
index 37cb36843a..ff22bdf0b3 100644
--- a/tests/specs/misc/dialIn.spec.ts
+++ b/tests/specs/misc/dialIn.spec.ts
@@ -110,12 +110,13 @@ describe('Dial-in', () => {
await dialIn(await ctx.p1.getDialInPin());
});
- it('wait for audio from dial-in participant', async () => {
+ it('wait for audio from dial-in participant', async function() {
const { p1 } = ctx;
if (!await p1.isInMuc()) {
// local participant did not join abort
- return;
+ // eslint-disable-next-line @typescript-eslint/no-invalid-this
+ this.skip();
}
await waitForAudioFromDialInParticipant(p1);
diff --git a/tests/specs/misc/followMe.spec.ts b/tests/specs/misc/followMe.spec.ts
index cf2cd14d98..810b28a727 100644
--- a/tests/specs/misc/followMe.spec.ts
+++ b/tests/specs/misc/followMe.spec.ts
@@ -20,19 +20,22 @@ describe('Follow me', () => {
await settings.submit();
});
- it('follow me checkbox visible only for moderators', async () => {
+ it('follow me checkbox visible only for moderators', async function() {
const { p2 } = ctx;
- if (!await p2.isModerator()) {
- await p2.getToolbar().clickSettingsButton();
+ if (await p2.isModerator()) {
+ // eslint-disable-next-line @typescript-eslint/no-invalid-this
+ this.skip();
+ }
- const settings = p2.getSettingsDialog();
+ await p2.getToolbar().clickSettingsButton();
- await settings.waitForDisplay();
- expect(await settings.isFollowMeDisplayed()).toBe(false);
+ const settings = p2.getSettingsDialog();
- await settings.clickCloseButton();
- }
+ await settings.waitForDisplay();
+ expect(await settings.isFollowMeDisplayed()).toBe(false);
+
+ await settings.clickCloseButton();
});
it('filmstrip commands', async () => {
diff --git a/tests/specs/moderation/lobby.spec.ts b/tests/specs/moderation/lobby.spec.ts
index 2bc4c3dc27..ab622e1d1e 100644
--- a/tests/specs/moderation/lobby.spec.ts
+++ b/tests/specs/moderation/lobby.spec.ts
@@ -200,11 +200,12 @@ describe('Lobby', () => {
expect(await p3.getLobbyScreen().isLobbyRoomJoined()).toBe(false);
});
- it('change of moderators in lobby', async () => {
+ it('change of moderators in lobby', async function() {
// The test below is only correct when the environment is configured to automatically elect a new moderator
// when the moderator leaves. For environments where this is not the case, the test is skipped.
if (!expectations.autoModerator) {
- return;
+ // eslint-disable-next-line @typescript-eslint/no-invalid-this
+ this.skip();
}
await hangupAllParticipants();
@@ -293,11 +294,12 @@ describe('Lobby', () => {
await p3.waitForRemoteStreams(2);
});
- it('moderator leaves while lobby enabled', async () => {
+ it('moderator leaves while lobby enabled', async function() {
// The test below is only correct when the environment is configured to automatically elect a new moderator
// when the moderator leaves. For environments where this is not the case, the test is skipped.
if (!expectations.autoModerator) {
- return;
+ // eslint-disable-next-line @typescript-eslint/no-invalid-this
+ this.skip();
}
const { p1, p2, p3 } = ctx;