@chief-clancy/brief 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Structural tests for brief command files.
3
+ *
4
+ * Verifies the commands directory contains the expected markdown files
5
+ * that the brief installer depends on.
6
+ */
7
+ import { readdirSync, readFileSync } from 'node:fs';
8
+ import { fileURLToPath } from 'node:url';
9
+
10
+ import { describe, expect, it } from 'vitest';
11
+
12
+ const COMMANDS_DIR = fileURLToPath(new URL('.', import.meta.url));
13
+
14
+ const EXPECTED_COMMANDS = ['brief.md'];
15
+
16
+ describe('commands directory structure', () => {
17
+ it('contains exactly the expected command files', () => {
18
+ const commands = readdirSync(COMMANDS_DIR)
19
+ .filter((f) => f.endsWith('.md'))
20
+ .sort();
21
+
22
+ expect(commands).toEqual([...EXPECTED_COMMANDS].sort());
23
+ });
24
+
25
+ it('all command files start with a heading', () => {
26
+ const issues: string[] = [];
27
+
28
+ EXPECTED_COMMANDS.forEach((file) => {
29
+ const content = readFileSync(new URL(file, import.meta.url), 'utf8');
30
+ const firstLine = content.split('\n')[0]?.trim() ?? '';
31
+
32
+ if (!firstLine.startsWith('#')) {
33
+ issues.push(file);
34
+ }
35
+ });
36
+
37
+ expect(issues).toEqual([]);
38
+ });
39
+ });