Skip to content

Test: Add missing test coverage for Git, ActivityPub, Nostr features #120

@melvincarvalho

Description

@melvincarvalho

Problem

Several major features have NO test coverage:

Feature Test File Status
Git backend - ❌ Missing
ActivityPub - ❌ Missing
Nostr relay - ❌ Missing
Single-user mode - ❌ Missing
Subdomain mode - ❌ Missing
Quota enforcement - ❌ Missing
Mashlib/SolidOS - ❌ Missing
Live reload live-reload.test.js ⚠️ Exists but non-standard (see #114)

Current test files (16) cover core LDP/Solid functionality well, but optional features are untested.

Proposed Solution

Create test files for each feature:

1. test/git.test.js

describe('Git HTTP Backend', () => {
  it('should clone a repository');
  it('should push changes with write access');
  it('should reject push without write access');
  it('should handle git-receive-pack');
  it('should handle git-upload-pack');
});

2. test/activitypub.test.js

describe('ActivityPub Federation', () => {
  it('should serve actor profile with AP Accept header');
  it('should accept incoming activities to inbox');
  it('should expose outbox');
  it('should handle Follow activity');
  it('should sign outgoing requests');
});

3. test/nostr.test.js

describe('Nostr Relay', () => {
  it('should accept WebSocket connections on relay path');
  it('should handle EVENT messages');
  it('should handle REQ subscriptions');
  it('should handle CLOSE');
  it('should enforce max events limit');
});

4. test/features.test.js

describe('Optional Features', () => {
  describe('Single-user mode', () => {
    it('should create pod on startup');
    it('should disable registration');
  });
  
  describe('Subdomain mode', () => {
    it('should extract pod name from subdomain');
    it('should isolate pods by subdomain');
  });
  
  describe('Quota enforcement', () => {
    it('should reject writes over quota');
    it('should track usage correctly');
  });
});

5. test/mashlib.test.js

describe('Mashlib Data Browser', () => {
  it('should serve mashlib.min.js');
  it('should serve mash.css');
  it('should redirect chunks in CDN mode');
  it('should inject data browser into HTML');
});

Benefits

  • Catch regressions in optional features
  • Document expected behavior
  • Enable confident refactoring
  • CI coverage for all features

Priority

P2 - Medium priority, high impact on confidence

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions