Skip to content

Commit 48a3f48

Browse files
author
Konstantin Shuplenkov
committed
Fix tests
1 parent fb2cd83 commit 48a3f48

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/__tests__/CreateAuthProvider.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ const createTestStore = (initData = {}) => {
1717
delete data[key];
1818
};
1919

20-
return {getItem, setItem, removeItem, getData}
20+
const updateItem = (key: string) => {
21+
return data[key];
22+
};
23+
24+
return {getItem, setItem, removeItem, getData, updateItem}
2125
};
2226

2327

@@ -31,15 +35,15 @@ describe('CreateAuthProvider', () => {
3135
expect(storage.getData()).toEqual({REACT_TOKEN_AUTH_KEY: '"test token"'});
3236
});
3337

34-
it('Check that token by key provided to token auth', async () => {
38+
it('Check that token by key provided to token auth', async() => {
3539
const storage = createTestStore();
3640
const [useAuth, authFetch, login, logout] = createAuthProvider({
3741
accessTokenKey: 'testKey',
38-
//@ts-ignore
42+
// @ts-ignore
3943
customFetch: async (input, init) => {
4044
return {
41-
input,
4245
init,
46+
input,
4347
};
4448
},
4549
storage

0 commit comments

Comments
 (0)