Skip to content

Commit 47688c8

Browse files
committed
add call time check
1 parent b8e334a commit 47688c8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/__tests__/commands.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ describe("login()", () => {
2222

2323
await login();
2424
expect(log).toMatchSnapshot();
25+
expect(atcoder.login).toBeCalledTimes(1);
2526
spy_console_log.mockRestore();
2627
})
2728
test("login fail", async () => {
@@ -31,6 +32,7 @@ describe("login()", () => {
3132

3233
await login();
3334
expect(log).toMatchSnapshot();
35+
expect(atcoder.login).toBeCalledTimes(1);
3436
spy_console_log.mockRestore();
3537
})
3638
});
@@ -42,6 +44,7 @@ describe("login()", () => {
4244

4345
await logout();
4446
expect(log).toMatchSnapshot();
47+
expect(atcoder.logout).toBeCalledTimes(1);
4548
spy_console_log.mockRestore();
4649
})
4750
});
@@ -53,6 +56,7 @@ describe("login()", () => {
5356

5457
await session();
5558
expect(log).toMatchSnapshot();
59+
expect(atcoder.checkSession).toBeCalledTimes(1);
5660
spy_console_log.mockRestore();
5761
})
5862
test("not logged-in", async () => {
@@ -62,6 +66,7 @@ describe("login()", () => {
6266

6367
await session();
6468
expect(log).toMatchSnapshot();
69+
expect(atcoder.checkSession).toBeCalledTimes(1);
6570
spy_console_log.mockRestore();
6671
})
6772
});

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy