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:
parent
10bf75a2ab
commit
10f7d57f13
@ -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 });
|
||||||
|
@ -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([]) },
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
Loading…
Reference in New Issue
Block a user