Skip to content

Commit

Permalink
add test code
Browse files Browse the repository at this point in the history
  • Loading branch information
Mimori256 committed Jan 28, 2024
1 parent 0cdca01 commit ec079f9
Show file tree
Hide file tree
Showing 8 changed files with 2,545 additions and 373 deletions.
11 changes: 7 additions & 4 deletions createICS.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import parseCSV from "./parse";
import kdb from "./kdb.json";
import parseCSV from "./parse";

const createICS = (fileContent: string, ifDeadlinesIncluded: boolean) => {
const isFromKdBAlt = fileContent.slice(0, 1) === "科";
Expand All @@ -10,9 +10,12 @@ const createICS = (fileContent: string, ifDeadlinesIncluded: boolean) => {
.map((x) => x.replace('"', ""))
.filter((x, i, self) => self.indexOf(x) === i)
: fileContent.split("\n").filter((x, i, self) => self.indexOf(x) === i);
return (
parseCSV(idList, kdb, ifDeadlinesIncluded, isFromKdBAlt) + `END:VCALENDAR`
);
return `${parseCSV(
idList,
kdb,
ifDeadlinesIncluded,
isFromKdBAlt,
)}END:VCALENDAR`;
};

export { createICS };
1 change: 1 addition & 0 deletions data/sample-2023.json

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
};
Loading

0 comments on commit ec079f9

Please sign in to comment.