Skip to content

Commit 12c4a01

Browse files
committed
fix(jellyfin): Fix tests not exiting
1 parent 1eada12 commit 12c4a01

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/backend/tests/jellyfin/jellyfin.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,27 +67,31 @@ describe("Jellyfin API Source", function() {
6767
expect(jf.usersBlock).to.be.eql(['someuser']);
6868
expect(jf.devicesAllow).to.be.eql(['web player']);
6969
expect(jf.devicesBlock).to.be.eql(['bad player']);
70+
await jf.destroy();
7071
});
7172

7273
it('Should include authenticating user as allowed when no others are set', async function () {
7374
const jf = createJfApi({...defaultJfApiCreds});
7475
await jf.buildInitData();
7576

7677
expect(jf.usersAllow).to.be.eql(['myuser']);
78+
await jf.destroy();
7779
});
7880

7981
it('Should set allowed users to empty array (allow all) when usersAllow is true', async function () {
8082
const jf = createJfApi({...defaultJfApiCreds, usersAllow: true});
8183
await jf.buildInitData();
8284

8385
expect(jf.usersAllow).to.be.empty;
86+
await jf.destroy();
8487
});
8588

8689
it('Should set allowed users to empty array (allow all) when usersAllow is an array with only one value equal to true', async function () {
8790
const jf = createJfApi({...defaultJfApiCreds, usersAllow: ['true']});
8891
await jf.buildInitData();
8992

9093
expect(jf.usersAllow).to.be.empty;
94+
await jf.destroy();
9195
});
9296
});
9397

@@ -99,6 +103,7 @@ describe("Jellyfin API Source", function() {
99103
expect(jf.isActivityValid('1234', 'SomeOtherUser')).to.not.be.true;
100104
expect(jf.isActivityValid('1234', 'MyUser')).to.be.true;
101105
expect(jf.isActivityValid('1234', 'myuser')).to.be.true;
106+
await jf.destroy();
102107
});
103108

104109
it('Show disallow activity based on user block', async function () {
@@ -108,6 +113,7 @@ describe("Jellyfin API Source", function() {
108113
expect(jf.isActivityValid('1234', 'BadUser')).to.not.be.true;
109114
expect(jf.isActivityValid('1234', 'MyUser')).to.be.true;
110115
expect(jf.isActivityValid('1234', 'myuser')).to.be.true;
116+
await jf.destroy();
111117
});
112118

113119
it('Show allow activity based on devices allow', async function () {
@@ -116,6 +122,7 @@ describe("Jellyfin API Source", function() {
116122

117123
expect(jf.isActivityValid('1234', 'MyUser')).to.not.be.true;
118124
expect(jf.isActivityValid('WebPlayer', 'MyUser')).to.be.true;
125+
await jf.destroy();
119126
});
120127

121128
it('Show disallow activity based on devices block', async function () {
@@ -124,6 +131,7 @@ describe("Jellyfin API Source", function() {
124131

125132
expect(jf.isActivityValid('1234', 'MyUser')).to.be.true;
126133
expect(jf.isActivityValid('WebPlayer', 'MyUser')).to.not.be.true;
134+
await jf.destroy();
127135
});
128136
});
129137
});

0 commit comments

Comments
 (0)