Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests: Reduce size of Wakatime fetcher test #3111

Merged
merged 2 commits into from
Aug 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 1 addition & 91 deletions tests/fetchWakatime.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,97 +112,7 @@ describe("Wakatime fetcher", () => {
.reply(200, wakaTimeData);

const repo = await fetchWakatimeStats({ username });
expect(repo).toMatchInlineSnapshot(`
{
"categories": [
{
"digital": "22:40",
"hours": 22,
"minutes": 40,
"name": "Coding",
"percent": 100,
"text": "22 hrs 40 mins",
"total_seconds": 81643.570077,
},
],
"daily_average": 16095,
"daily_average_including_other_language": 16329,
"days_including_holidays": 7,
"days_minus_holidays": 5,
"editors": [
{
"digital": "22:40",
"hours": 22,
"minutes": 40,
"name": "VS Code",
"percent": 100,
"text": "22 hrs 40 mins",
"total_seconds": 81643.570077,
},
],
"holidays": 2,
"human_readable_daily_average": "4 hrs 28 mins",
"human_readable_daily_average_including_other_language": "4 hrs 32 mins",
"human_readable_total": "22 hrs 21 mins",
"human_readable_total_including_other_language": "22 hrs 40 mins",
"id": "random hash",
"is_already_updating": false,
"is_coding_activity_visible": true,
"is_including_today": false,
"is_other_usage_visible": true,
"is_stuck": false,
"is_up_to_date": true,
"languages": [
{
"digital": "0:19",
"hours": 0,
"minutes": 19,
"name": "Other",
"percent": 1.43,
"text": "19 mins",
"total_seconds": 1170.434361,
},
{
"digital": "0:01",
"hours": 0,
"minutes": 1,
"name": "TypeScript",
"percent": 0.1,
"text": "1 min",
"total_seconds": 83.293809,
},
{
"digital": "0:00",
"hours": 0,
"minutes": 0,
"name": "YAML",
"percent": 0.07,
"text": "0 secs",
"total_seconds": 54.975151,
},
],
"operating_systems": [
{
"digital": "22:40",
"hours": 22,
"minutes": 40,
"name": "Mac",
"percent": 100,
"text": "22 hrs 40 mins",
"total_seconds": 81643.570077,
},
],
"percent_calculated": 100,
"range": "last_7_days",
"status": "ok",
"timeout": 15,
"total_seconds": 80473.135716,
"total_seconds_including_other_language": 81643.570077,
"user_id": "random hash",
"username": "anuraghazra",
"writes_only": false,
}
`);
expect(repo).toStrictEqual(wakaTimeData.data);
});

it("should throw error if username param missing", async () => {
Expand Down
Loading