diff --git a/packages/starlight-blog/tests/unit/show-reading-time/readingTime.test.ts b/packages/starlight-blog/tests/unit/show-reading-time/readingTime.test.ts new file mode 100644 index 0000000..9fee19d --- /dev/null +++ b/packages/starlight-blog/tests/unit/show-reading-time/readingTime.test.ts @@ -0,0 +1,15 @@ +import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest' + +import { calculateReadingTime, getReadingTime, formatReadingTime } from '../../../libs/readingTime' + +describe('getReadingTime', () => { + test('show reading time, overridden by frontmatter', () => { + expect(getReadingTime()).toBe(1) + expect(getReadingTime()).toBe(1) + }) + + test('show reading time, calculated automatically', () => { + expect(getReadingTime()).toBe(1) + expect(getReadingTime()).toBe(1) + }) +}) \ No newline at end of file