Skip to content

Commit

Permalink
Assign new spy instances before each test
Browse files Browse the repository at this point in the history
  • Loading branch information
paescuj committed May 18, 2023
1 parent b8a2698 commit 1359244
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/src/stores/server.test.ts
Expand Up @@ -62,7 +62,7 @@ let apiGetSpy: SpyInstance;
let replaceQueueSpy: SpyInstance;
let setLanguageSpy: SpyInstance;

beforeAll(() => {
beforeEach(() => {
apiGetSpy = vi.spyOn(api, 'get');
replaceQueueSpy = vi.spyOn(apiFunctions, 'replaceQueue').mockResolvedValue();
setLanguageSpy = vi.spyOn(setLanguageDefault, 'setLanguage').mockResolvedValue(true);
Expand Down
2 changes: 1 addition & 1 deletion app/src/stores/settings.test.ts
Expand Up @@ -98,7 +98,7 @@ vi.mock('@/api', () => {

let apiGetSpy: SpyInstance;

beforeAll(() => {
beforeEach(() => {
apiGetSpy = vi.spyOn(api, 'get');
});

Expand Down

0 comments on commit 1359244

Please sign in to comment.