Skip to content

Commit 1334689

Browse files
committed
chore: testActiveDirectoryAuth cleanup, remove old test packages from cli
1 parent 5ada78a commit 1334689

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

packages/git-proxy-cli/package.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
"yargs": "^17.7.2",
1111
"@finos/git-proxy": "file:../.."
1212
},
13-
"devDependencies": {
14-
"chai": "^4.5.0",
15-
"ts-mocha": "^11.1.0"
16-
},
1713
"scripts": {
1814
"build": "tsc",
1915
"lint": "eslint \"./*.ts\" --fix",

test/testActiveDirectoryAuth.test.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { describe, it, beforeEach, expect, vi, type Mock } from 'vitest';
1+
import { describe, it, beforeEach, expect, vi, type Mock, afterEach } from 'vitest';
22

33
let ldapStub: { isUserInAdGroup: Mock };
44
let dbStub: { updateUser: Mock };
@@ -33,9 +33,6 @@ const newConfig = JSON.stringify({
3333

3434
describe('ActiveDirectory auth method', () => {
3535
beforeEach(async () => {
36-
vi.clearAllMocks();
37-
vi.resetModules();
38-
3936
ldapStub = {
4037
isUserInAdGroup: vi.fn(),
4138
};
@@ -84,6 +81,11 @@ describe('ActiveDirectory auth method', () => {
8481
configure(passportStub as any);
8582
});
8683

84+
afterEach(() => {
85+
vi.clearAllMocks();
86+
vi.resetModules();
87+
});
88+
8789
it('should authenticate a valid user and mark them as admin', async () => {
8890
const mockReq = {};
8991
const mockProfile = {

0 commit comments

Comments
 (0)