TuitioState's token property can be null

master
Tudor Stanciu 2023-02-12 02:42:30 +02:00
parent 7fcb55dbc7
commit 95d41e9361
3 changed files with 4 additions and 3 deletions

View File

@ -36,4 +36,5 @@ All tests in the package can be executed by running: `npm test`.
1.0.0 - Package initialization
1.0.1 - Export Tuitio types
1.0.2 - Validate that Tuitio's URL parameter is a valid URL
1.0.3 - Added LICENSE file
1.0.3 - Added LICENSE file
1.0.4 - TuitioState's token property can be null

View File

@ -24,7 +24,7 @@ test("Tuitio client authentication", async () => {
expect(result.status).toBe("_MOCK_");
const storage = fetch();
expect(storage.token.raw).toBe("mock-user-pass");
expect(storage.token?.raw).toBe("mock-user-pass");
expect(storage.userName).toBe("user");
invalidate();

View File

@ -58,7 +58,7 @@ const invalidate = (): void => {
}
};
export type TuitioState = { token: TuitioToken; userName: string };
export type TuitioState = { token: TuitioToken | null; userName: string };
const fetch = (): TuitioState => {
const data = {