summaryrefslogtreecommitdiff
path: root/src/flatmatter.test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/flatmatter.test.ts')
-rw-r--r--src/flatmatter.test.ts16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/flatmatter.test.ts b/src/flatmatter.test.ts
new file mode 100644
index 0000000..4c349aa
--- /dev/null
+++ b/src/flatmatter.test.ts
@@ -0,0 +1,16 @@
+import FlatMatter from "./flatmatter";
+import {assert} from "vitest";
+
+test('Line has no value separator', () => {
+ expect(() => new FlatMatter('test'))
+ .toThrowError("Line on index 0 doesn't have a value separator.");
+})
+
+test('Line can only have one value separator', () => {
+ expect(() => new FlatMatter('test: this: that'))
+ .toThrowError("Line on index 0 has multiple value separators.")
+})
+
+test('String values can have colon characters', () => {
+ assert.doesNotThrow(() => new FlatMatter('test: "this : that"'), Error)
+}) \ No newline at end of file