diff options
| author | Asko Nõmm <asko@nmm.ee> | 2025-01-25 17:43:05 +0200 |
|---|---|---|
| committer | Asko Nõmm <asko@nmm.ee> | 2025-01-25 17:43:05 +0200 |
| commit | 7f3a7e9770623743fde1cc9fde8aea7d476a5700 (patch) | |
| tree | 6a488b28202d7e900ae31eff377d9f95cd78a175 /src/flatmatter.test.ts | |
| parent | d7350b9638b7c34707d262586b6d253d3fe48d5e (diff) | |
Implement line conformance validators.
Diffstat (limited to 'src/flatmatter.test.ts')
| -rw-r--r-- | src/flatmatter.test.ts | 16 |
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 |
