- Mock `readRelays` in `tests/app-batch-fetch-profiles.test.mjs` to correctly reflect `profileMetadataService` prioritization logic, ensuring relay query count assertions match actual execution.
- Add missing `load` mock to `hashtagPreferences` in `tests/profile-modal-controller.test.mjs` to prevent `TypeError` during `handleAddHashtagPreference` test.
- Update `netlify.toml` to set `NODE_ENV = "development"` during build, ensuring `devDependencies` (required for `npm run build:css`) are installed.
- Verified all unit tests pass locally.
- Verified build configuration syntax.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Mock `readRelays` in `tests/app-batch-fetch-profiles.test.mjs` to correctly reflect `profileMetadataService` prioritization logic, ensuring relay query count assertions match actual execution (2 queries instead of 4).
- Add missing `load` mock to `hashtagPreferences` in `tests/profile-modal-controller.test.mjs` to prevent `TypeError` during `handleAddHashtagPreference` test.
- Verified all unit tests pass with `npm run test:unit`.
- Reverted risky dependency moves in `package.json` to maintain project structure.
- Build process verified locally; addressing test failures is the primary fix for the reported CI errors.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Mock `readRelays` in `tests/app-batch-fetch-profiles.test.mjs` to correctly reflect `profileMetadataService` prioritization logic, ensuring relay query count assertions match actual execution (2 queries instead of 4).
- Add missing `load` mock to `hashtagPreferences` in `tests/profile-modal-controller.test.mjs` to prevent `TypeError` during `handleAddHashtagPreference` test.
- Verified all unit tests pass with `npm run test:unit`.
- Verified `npm run build` succeeds locally.
- Verified `_headers` and `_redirects` are present and valid in `dist/`.
This commit addresses the CI failures reported by the user, including the `agent-review` failure and likely resolving the associated 'Deploy failed' checks.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Updated `cross-env` to latest version.
- Updated `package-lock.json` to resolve build warnings and potential CI cache issues.
- Includes previous test fixes and onboarding report.
Co-authored-by: PR0M3TH3AN <[email protected]>
Fixed failing unit tests identified during onboarding audit:
- Mocked readRelays in tests/app-batch-fetch-profiles.test.mjs to prevent network leakage
- Mocked hashtagPreferencesService.load in tests/profile-modal-controller.test.mjs to fix TypeError
- Added ONBOARDING_REPORT.md with audit details
Co-authored-by: PR0M3TH3AN <[email protected]>
Updated `tests/app-batch-fetch-profiles.test.mjs` to correctly mock `readRelays` in addition to `relays` and `writeRelays`. `profileMetadataService.js` prioritizes `readRelays`, causing the test to make unexpected network calls when falling back to default values. This fix ensures the test isolation holds and assertions pass consistently.
Also fixed a failing mock in `tests/profile-modal-controller.test.mjs` by adding a missing `load()` method to the `hashtagPreferences` service stub.
Co-authored-by: PR0M3TH3AN <[email protected]>
Added the missing `load()` method to the `hashtagPreferences` mock in `tests/profile-modal-controller.test.mjs`. This resolves the `TypeError` encountered during the `handleAddHashtagPreference` test case, ensuring the test suite passes consistently in CI.
Co-authored-by: PR0M3TH3AN <[email protected]>
Updated `tests/app-batch-fetch-profiles.test.mjs` to correctly mock `readRelays` in addition to `relays` and `writeRelays`. `profileMetadataService.js` prioritizes `readRelays`, causing the test to make unexpected network calls when falling back to default values. This fix ensures the test isolation holds and assertions pass consistently.
Co-authored-by: PR0M3TH3AN <[email protected]>
This script validates protocol interoperability by publishing Video Post and View events, and sending Encrypted DMs using ephemeral keys against public relays. It ensures the NostrClient facade and event builders function correctly in a Node.js environment.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Update `tests/profile-modal-controller.test.mjs` to include a mock for `hashtagPreferences.load`.
- Fixes `TypeError: this.hashtagPreferencesService.load is not a function` in unit tests.
- Ensures all tests pass locally.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Update `tests/app-batch-fetch-profiles.test.mjs` to correctly mock `nostrClient.readRelays`.
- Ensure deterministic relay query counts in unit tests.
- Fixes CI failure where `actual: 4` vs `expected: 2` due to unmocked read relays.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Update `scripts/agent/telemetry-aggregator.mjs` to use a stricter regex for parsing generic logs.
- Require brackets (e.g., `[ERROR]`, `[WARN]`) or trailing colons/word boundaries (e.g., `Error:`, `FAIL`) to match errors.
- Prevent false positives from status messages like "0 errors" or "0 failures".
- Support `[WARN]` as Medium severity.
- Ensure PII sanitization and `ENABLE_TELEMETRY` guardrails are preserved.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Adds `load: async () => {}` to the `hashtagPreferences` mock in `tests/profile-modal-controller.test.mjs`.
- Fixes `TypeError: this.hashtagPreferencesService.load is not a function` during `handleAddHashtagPreference` test execution.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Sets `nostrClient.readRelays` in `tests/app-batch-fetch-profiles.test.mjs` to match the test relays.
- Fixes `AssertionError: expected a query per relay. 4 !== 2` caused by falling back to default read relays.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Created `scripts/agent/validate-events.mjs` to verify all event builders produce valid events against the schema.
- Instrumented `js/nostr/nip71.js` to validate NIP-71 events during construction (other builders in `js/nostrEventSchemas.js` were already instrumented).
- Validated all 25 event types using the new tool.
Co-authored-by: PR0M3TH3AN <[email protected]>