forked from Lilly-Protocol/lily-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchangelog.test.ts
More file actions
34 lines (29 loc) · 1.04 KB
/
Copy pathchangelog.test.ts
File metadata and controls
34 lines (29 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import { describe, it, expect } from 'vitest';
import { readFileSync } from 'node:fs';
import { resolve } from 'node:path';
/**
* Bounty #52 — $25
* "Add a CHANGELOG.md and link it from the README"
*
* Verifies that CHANGELOG.md exists and is referenced in the README.
*/
describe('CHANGELOG.md', () => {
const changelogPath = resolve(process.cwd(), 'CHANGELOG.md');
const readmePath = resolve(process.cwd(), 'README.md');
it('CHANGELOG.md exists', () => {
const content = readFileSync(changelogPath, 'utf8');
expect(content.length).toBeGreaterThan(0);
});
it('CHANGELOG.md has a main heading', () => {
const content = readFileSync(changelogPath, 'utf8');
expect(content).toMatch(/^# /m);
});
it('CHANGELOG.md has at least one version section', () => {
const content = readFileSync(changelogPath, 'utf8');
expect(content).toMatch(/^## /m);
});
it('README.md links to CHANGELOG.md', () => {
const readme = readFileSync(readmePath, 'utf8');
expect(readme.toLowerCase()).toContain('changelog');
});
});