1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00

fix: remove remaining warnings in tests (#3296)

This commit is contained in:
Mateusz Kwasniewski 2023-03-10 12:12:17 +01:00 committed by GitHub
parent 10bf75a2ab
commit 10f7d57f13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -16,6 +16,7 @@ beforeEach(() => {
test('should not set user if unknown token', async () => {
const accountService = {
getAccountByPersonalAccessToken: jest.fn(),
addPATSeen: jest.fn(),
};
const func = patMiddleware(config, { accountService });
@ -65,6 +66,7 @@ test('should add user if known token', async () => {
});
const accountService = {
getAccountByPersonalAccessToken: jest.fn().mockReturnValue(apiUser),
addPATSeen: jest.fn(),
};
const func = patMiddleware(config, { accountService });

View File

@ -34,12 +34,18 @@ jest.mock('./metrics', () => ({
jest.mock('./db', () => ({
createStores() {
return {
db: { destroy: () => undefined },
clientInstanceStore: { destroy: noop },
db: {
destroy: () => undefined,
},
clientInstanceStore: {
destroy: noop,
removeInstancesOlderThanTwoDays: noop,
},
clientMetricsStore: { destroy: noop, on: noop },
eventStore,
publicSignupTokenStore: { destroy: noop, on: noop },
settingStore,
projectStore: { getAll: () => Promise.resolve([]) },
};
},
}));