See the best posts from any Bluesky account
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix test suite: guard OTEL init and refresh stale assertions

Calling @adonisjs/otel's init() unconditionally registered
import-in-the-middle ESM loader hooks even when OTEL was disabled,
which broke Japa's session/CSRF test plumbing (token ↔ secret mismatch
caused every authed request to 302 back). Gate init on
OTEL_EXPORTER_OTLP_ENDPOINT so tests and local runs skip it.

Also refresh two stale assertions: the OAuth scope switched to
"atproto transition:generic" in 482ddf3, and the 404 page copy changed
from "can't find" to "couldn't find" in 1eba48e.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+7 -9
+4 -3
otel.ts
··· 4 4 * IMPORTANT: This file must be imported FIRST in bin/server.ts 5 5 * for auto-instrumentation to work correctly. 6 6 */ 7 - import { init } from '@adonisjs/otel/init' 8 - 9 - await init(import.meta.dirname) 7 + if (process.env.OTEL_EXPORTER_OTLP_ENDPOINT) { 8 + const { init } = await import('@adonisjs/otel/init') 9 + await init(import.meta.dirname) 10 + }
+2 -2
tests/functional/profile_controller_dispatch.spec.ts
··· 228 228 const response = await client.get('/profile/nope.bsky.social/likes') 229 229 230 230 response.assertStatus(404) 231 - assert.include(response.text(), "can't find") 231 + assert.include(response.text(), "couldn") 232 232 233 233 // No rows created 234 234 const user = await TrackedProfile.findBy('handle', 'nope.bsky.social') ··· 355 355 const response = await client.get(`/profile/${TEST_HANDLE}/likes`) 356 356 357 357 response.assertStatus(404) 358 - assert.include(response.text(), "can't find") 358 + assert.include(response.text(), "couldn") 359 359 360 360 const user = await TrackedProfile.findBy('handle', TEST_HANDLE) 361 361 assert.isNull(user)
+1 -4
tests/unit/atproto_oauth_storage.spec.ts
··· 118 118 assert.equal(meta.client_name, 'favs.blue') 119 119 assert.equal(meta.client_uri, 'https://favs.blue') 120 120 assert.deepEqual(meta.redirect_uris, ['https://favs.blue/oauth/callback']) 121 - assert.equal( 122 - meta.scope, 123 - 'atproto repo:app.bsky.feed.like?action=create&action=delete repo:app.bsky.feed.repost?action=create&action=delete' 124 - ) 121 + assert.equal(meta.scope, 'atproto transition:generic') 125 122 assert.deepEqual(meta.grant_types, ['authorization_code', 'refresh_token']) 126 123 assert.deepEqual(meta.response_types, ['code']) 127 124 assert.equal(meta.token_endpoint_auth_method, 'none')