Skip to content

Commit

Permalink
test: stub out more
Browse files Browse the repository at this point in the history
  • Loading branch information
aalemayhu committed Sep 14, 2023
1 parent eda93a1 commit 18ce2cc
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/csv-to-apkg.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// eslint-disable-next-line import/no-extraneous-dependencies
import { describe, it, expect, fail } from 'vitest';

import convertCSVToAPKG, { CSVReader } from './csv-to-apkg';
import convertCSVToAPKG, { CSVReader, DataMapper } from './csv-to-apkg';

const CSV_EXAMPLE = `
Word,Meaning,Tags
Expand Down
32 changes: 29 additions & 3 deletions src/csv-to-apkg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,42 @@ export default function convertCSVToAPKG(): string | null {

export type CSVColumnHeader = string
export type CSVRow = string
export type CSVData = {
headers: CSVColumnHeader[];
rows: CSVRow[];
}

export class CSVReader {

constructor(readonly content: string) {}
constructor(readonly content: string) { }

getHeaders(): CSVColumnHeader {
getHeaders(): CSVColumnHeader[] {
throw new Error("not implemented")
}

getRows(): CSVRow {
getRows(): CSVRow[] {
throw new Error("not implemented")
}

parseSync(): CSVData {
throw new Error("To be implemented")
}
}

export type Note = {
id: number;
front: string;
back: string;
tags: string;
}

export type Deck = {
subDecks: Deck[];
name: string;
notes: Note[];
}
export class DataMapper {
getDecks(): Deck {
throw new Error("To be implemented")
}
}

0 comments on commit 18ce2cc

Please sign in to comment.