1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-20 00:08:02 +01: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 () => { test('should not set user if unknown token', async () => {
const accountService = { const accountService = {
getAccountByPersonalAccessToken: jest.fn(), getAccountByPersonalAccessToken: jest.fn(),
addPATSeen: jest.fn(),
}; };
const func = patMiddleware(config, { accountService }); const func = patMiddleware(config, { accountService });
@ -65,6 +66,7 @@ test('should add user if known token', async () => {
}); });
const accountService = { const accountService = {
getAccountByPersonalAccessToken: jest.fn().mockReturnValue(apiUser), getAccountByPersonalAccessToken: jest.fn().mockReturnValue(apiUser),
addPATSeen: jest.fn(),
}; };
const func = patMiddleware(config, { accountService }); const func = patMiddleware(config, { accountService });

View File

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