Skip to content

Commit 711ee2b

Browse files
committed
add ical parsing tests
1 parent 95b8b4c commit 711ee2b

File tree

3 files changed

+43
-4
lines changed

3 files changed

+43
-4
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"eslint-plugin-prettier": "^5.2.1",
4242
"husky": "^9.1.4",
4343
"lint-staged": "^15.2.8",
44+
"node-ical": "^0.18.0",
4445
"prettier": "^3.3.3",
4546
"request": "^2.88.2",
4647
"supertest": "^7.0.0",

tests/live/ical.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { expect, test } from "vitest";
22
import { InternalServerError } from "../../src/errors/index.js";
3-
import { EventsGetResponse } from "../../src/routes/events.js";
43
import { describe } from "node:test";
54
import { OrganizationList } from "../../src/orgs.js";
5+
import ical from "node-ical";
66

77
const appKey = process.env.APPLICATION_KEY;
88
if (!appKey) {
@@ -23,6 +23,8 @@ describe("Getting specific calendars", async () => {
2323
expect(response.headers.get("Content-Disposition")).toEqual(
2424
'attachment; filename="calendar.ics"',
2525
);
26+
const calendar = ical.sync.parseICS(await response.text());
27+
expect(calendar["vcalendar"]["type"]).toEqual("VCALENDAR");
2628
});
2729
}
2830
});

yarn.lock

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2090,6 +2090,15 @@ aws4@^1.8.0:
20902090
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.13.1.tgz#bb5f8b8a20739f6ae1caeaf7eea2c7913df8048e"
20912091
integrity sha512-u5w79Rd7SU4JaIlA/zFqG+gOiuq25q5VLyZ8E+ijJeILuTxVzZgp2CaGw/UTw6pXYN9XMO9yiqj/nEHmhTG5CA==
20922092

2093+
2094+
version "1.6.7"
2095+
resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.7.tgz#7b48c2e27c96f9c68a2f8f31e2ab19f59b06b0a7"
2096+
integrity sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==
2097+
dependencies:
2098+
follow-redirects "^1.15.4"
2099+
form-data "^4.0.0"
2100+
proxy-from-env "^1.1.0"
2101+
20932102
babel-eslint@^10.0.1:
20942103
version "10.1.0"
20952104
resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.1.0.tgz#6968e568a910b78fb3779cdd8b6ac2f479943232"
@@ -3253,6 +3262,11 @@ flatted@^3.2.9, flatted@^3.3.1:
32533262
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.3.1.tgz#21db470729a6734d4997002f439cb308987f567a"
32543263
integrity sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==
32553264

3265+
follow-redirects@^1.15.4:
3266+
version "1.15.6"
3267+
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b"
3268+
integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==
3269+
32563270
for-each@^0.3.3:
32573271
version "0.3.3"
32583272
resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e"
@@ -4231,7 +4245,7 @@ [email protected]:
42314245
dependencies:
42324246
obliterator "^2.0.1"
42334247

4234-
moment-timezone@^0.5.45:
4248+
moment-timezone@^0.5.44, moment-timezone@^0.5.45:
42354249
version "0.5.45"
42364250
resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.45.tgz#cb685acd56bac10e69d93c536366eb65aa6bcf5c"
42374251
integrity sha512-HIWmqA86KcmCAhnMAN0wuDOARV/525R2+lOLotuGFzn4HO+FH+/645z2wx0Dt3iDv6/p61SIvKnDstISainhLQ==
@@ -4296,6 +4310,16 @@ nmtree@^1.0.6:
42964310
dependencies:
42974311
commander "^2.11.0"
42984312

4313+
node-ical@^0.18.0:
4314+
version "0.18.0"
4315+
resolved "https://registry.yarnpkg.com/node-ical/-/node-ical-0.18.0.tgz#919ab65f43cdfebb4ac9a1c2acca2b5e62cc003f"
4316+
integrity sha512-FrOUPztjw9OUgSB9o/ffhl86BiVClQTut97C2NqCwKIgOAcKPEw5UQMuSuNJO/Y4hqTyJdKZh2TCqNHQnE9YFg==
4317+
dependencies:
4318+
axios "1.6.7"
4319+
moment-timezone "^0.5.44"
4320+
rrule "2.8.1"
4321+
uuid "^9.0.0"
4322+
42994323
npm-run-path@^5.1.0:
43004324
version "5.3.0"
43014325
resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-5.3.0.tgz#e23353d0ebb9317f174e93417e4a4d82d0249e9f"
@@ -4613,6 +4637,11 @@ proxy-addr@^2.0.7:
46134637
forwarded "0.2.0"
46144638
ipaddr.js "1.9.1"
46154639

4640+
proxy-from-env@^1.1.0:
4641+
version "1.1.0"
4642+
resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2"
4643+
integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==
4644+
46164645
pseudomap@^1.0.2:
46174646
version "1.0.2"
46184647
resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3"
@@ -4801,6 +4830,13 @@ rollup@^4.13.0:
48014830
"@rollup/rollup-win32-x64-msvc" "4.20.0"
48024831
fsevents "~2.3.2"
48034832

4833+
4834+
version "2.8.1"
4835+
resolved "https://registry.yarnpkg.com/rrule/-/rrule-2.8.1.tgz#e8341a9ce3e68ce5b8da4d502e893cd9f286805e"
4836+
integrity sha512-hM3dHSBMeaJ0Ktp7W38BJZ7O1zOgaFEsn41PDk+yHoEtfLV+PoJt9E9xAlZiWgf/iqEqionN0ebHFZIDAp+iGw==
4837+
dependencies:
4838+
tslib "^2.4.0"
4839+
48044840
run-async@^2.4.0:
48054841
version "2.4.1"
48064842
resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455"
@@ -5342,7 +5378,7 @@ tslib@^1.9.0:
53425378
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
53435379
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==
53445380

5345-
tslib@^2.1.0, tslib@^2.6.2:
5381+
tslib@^2.1.0, tslib@^2.4.0, tslib@^2.6.2:
53465382
version "2.6.3"
53475383
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.3.tgz#0438f810ad7a9edcde7a241c3d80db693c8cbfe0"
53485384
integrity sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==
@@ -5489,7 +5525,7 @@ uuid@^3.3.2:
54895525
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee"
54905526
integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==
54915527

5492-
uuid@^9.0.1:
5528+
uuid@^9.0.0, uuid@^9.0.1:
54935529
version "9.0.1"
54945530
resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.1.tgz#e188d4c8853cc722220392c424cd637f32293f30"
54955531
integrity sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==

0 commit comments

Comments
 (0)