Repository navigation
Expand file tree
/
Copy pathfetchData_async_Example.test.js
More file actions
43 lines (39 loc) · 1.51 KB
/
Copy pathfetchData_async_Example.test.js
File metadata and controls
43 lines (39 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/**
# * @author Rajat Verma
# * Email: rajatvermaa95@gmail.com
# * Github Profile: https://github.com/rajatt95
# * Github Page: https://rajatt95.github.io/
# * LinkedIn: https://www.linkedin.com/in/rajatt95/
# * Topmate: https://topmate.io/rajatt95
# * Telegram: https://t.me/rajatt95
# * Instagram: https://www.instagram.com/rajattvermaa95/
# * Youtube: https://www.youtube.com/@rajatt95
# * WhatsApp: https://chat.whatsapp.com/DVRP0ViD0YwELUKF2XMJHy
#
# ***********************************
# * Course: Jest JavaScript Testing Framework (https://testautomationu.applitools.com/jest-testing-tutorial/)
# * Tutor: Toyer Mamoojee (https://testautomationu.applitools.com/instructors/toyer_mamoojee.html)
# ***********************************
#
# * Code Repository: https://github.com/rajatt95/Tutorial_TAU_TM_Jest
# * Document(s): https://github.com/rajatt95/Documents
#
# ***********************************
# * Learnings from Tutor (Code Repository):
# * This course
# * https://github.com/stars/rajatt95/lists/tau-tm-jest
# * Other course(s):
# * https://github.com/stars/rajatt95/lists/tau-toyer-mamoojee
# *
# ***********************************/
const fetchDataOverApi = require('./fetchData.js');
// Non-Async Example
test('User Data for User 1', ()=>{
const data = fetchDataOverApi();
expect(data).toBe('https://www.youtube.com/@rajatt95')
});
// Async Example
test('User Data for User 1', async()=>{
const data = await fetchDataOverApi();
expect(data).toBe('https://www.youtube.com/@rajatt95')
});