test: cover lib/extension/ to 100% (T-89)
test / unit + widget + golden + a11y (push) Failing after 31s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 28s

Adds tests for the previously-uncovered ClideExtensionContext sugar
(publish/subscribe/t/tr) and the default no-op ClideExtension
lifecycle hooks, driving the real context the ExtensionManager builds,
plus ExtensionScanner.defaultRoot + the no-arg discover() fallback.
lib/extension/ goes 74.1% -> 100%; total 95.06% -> 95.23%. Floor
unchanged (no integer crossing).

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-05-22 09:02:15 +02:00
co-authored by Claude
parent 498bbc1205
commit fd72940d2d
4 changed files with 183 additions and 0 deletions
+14
View File
@@ -52,5 +52,19 @@ void main() {
final out = await const ExtensionScanner().discover(root: root);
expect(out.map((m) => m.id).toList(), ['ext.ok']);
});
test('defaultRoot points at ~/.clide/extensions', () {
final scanner = ExtensionScanner();
final home = Platform.environment['HOME'] ?? '/tmp';
expect(scanner.defaultRoot().path, '$home/.clide/extensions');
});
test('discover() with no root falls back to defaultRoot', () async {
// Exercises the `root ?? defaultRoot()` fallback. The install
// root rarely exists in CI, so this returns a (possibly empty)
// list rather than throwing.
final out = await const ExtensionScanner().discover();
expect(out, isA<List<ExtensionManifest>>());
});
});
}