@atproto/bsky 0.0.243 → 0.0.244
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.
- package/CHANGELOG.md +19 -0
- package/dist/api/app/bsky/actor/searchActorsTypeahead.js +5 -3
- package/dist/api/app/bsky/actor/searchActorsTypeahead.js.map +1 -1
- package/dist/api/app/bsky/notification/putPreferencesV2.js +4 -1
- package/dist/api/app/bsky/notification/putPreferencesV2.js.map +1 -1
- package/dist/api/app/bsky/notification/util.d.ts +1 -0
- package/dist/api/app/bsky/notification/util.d.ts.map +1 -1
- package/dist/api/app/bsky/notification/util.js +7 -7
- package/dist/api/app/bsky/notification/util.js.map +1 -1
- package/dist/api/blob-dispatcher.d.ts.map +1 -1
- package/dist/api/blob-dispatcher.js +9 -8
- package/dist/api/blob-dispatcher.js.map +1 -1
- package/dist/api/blob-resolver.d.ts +1 -1
- package/dist/api/blob-resolver.d.ts.map +1 -1
- package/dist/api/blob-resolver.js +0 -1
- package/dist/api/blob-resolver.js.map +1 -1
- package/dist/data-plane/bsync/index.d.ts +2 -0
- package/dist/data-plane/bsync/index.d.ts.map +1 -1
- package/dist/data-plane/bsync/index.js +7 -10
- package/dist/data-plane/bsync/index.js.map +1 -1
- package/dist/data-plane/server/background.d.ts +12 -8
- package/dist/data-plane/server/background.d.ts.map +1 -1
- package/dist/data-plane/server/background.js +32 -14
- package/dist/data-plane/server/background.js.map +1 -1
- package/dist/data-plane/server/index.d.ts +2 -0
- package/dist/data-plane/server/index.d.ts.map +1 -1
- package/dist/data-plane/server/index.js +7 -10
- package/dist/data-plane/server/index.js.map +1 -1
- package/dist/data-plane/server/indexing/index.d.ts +2 -2
- package/dist/data-plane/server/indexing/index.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/index.js.map +1 -1
- package/dist/data-plane/server/indexing/plugins/block.d.ts +1 -1
- package/dist/data-plane/server/indexing/plugins/block.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/block.js.map +1 -1
- package/dist/data-plane/server/indexing/plugins/chat-declaration.d.ts +1 -1
- package/dist/data-plane/server/indexing/plugins/chat-declaration.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/chat-declaration.js.map +1 -1
- package/dist/data-plane/server/indexing/plugins/feed-generator.d.ts +1 -1
- package/dist/data-plane/server/indexing/plugins/feed-generator.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/feed-generator.js.map +1 -1
- package/dist/data-plane/server/indexing/plugins/follow.d.ts +1 -1
- package/dist/data-plane/server/indexing/plugins/follow.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/follow.js.map +1 -1
- package/dist/data-plane/server/indexing/plugins/germ-declaration.d.ts +1 -1
- package/dist/data-plane/server/indexing/plugins/germ-declaration.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/germ-declaration.js.map +1 -1
- package/dist/data-plane/server/indexing/plugins/labeler.d.ts +1 -1
- package/dist/data-plane/server/indexing/plugins/labeler.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/labeler.js.map +1 -1
- package/dist/data-plane/server/indexing/plugins/like.d.ts +1 -1
- package/dist/data-plane/server/indexing/plugins/like.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/like.js.map +1 -1
- package/dist/data-plane/server/indexing/plugins/list-block.d.ts +1 -1
- package/dist/data-plane/server/indexing/plugins/list-block.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/list-block.js.map +1 -1
- package/dist/data-plane/server/indexing/plugins/list-item.d.ts +1 -1
- package/dist/data-plane/server/indexing/plugins/list-item.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/list-item.js.map +1 -1
- package/dist/data-plane/server/indexing/plugins/list.d.ts +1 -1
- package/dist/data-plane/server/indexing/plugins/list.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/list.js.map +1 -1
- package/dist/data-plane/server/indexing/plugins/notif-declaration.d.ts +1 -1
- package/dist/data-plane/server/indexing/plugins/notif-declaration.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/notif-declaration.js.map +1 -1
- package/dist/data-plane/server/indexing/plugins/post-gate.d.ts +1 -1
- package/dist/data-plane/server/indexing/plugins/post-gate.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/post-gate.js.map +1 -1
- package/dist/data-plane/server/indexing/plugins/post.d.ts +1 -1
- package/dist/data-plane/server/indexing/plugins/post.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/post.js.map +1 -1
- package/dist/data-plane/server/indexing/plugins/profile.d.ts +1 -1
- package/dist/data-plane/server/indexing/plugins/profile.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/profile.js.map +1 -1
- package/dist/data-plane/server/indexing/plugins/repost.d.ts +1 -1
- package/dist/data-plane/server/indexing/plugins/repost.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/repost.js.map +1 -1
- package/dist/data-plane/server/indexing/plugins/starter-pack.d.ts +1 -1
- package/dist/data-plane/server/indexing/plugins/starter-pack.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/starter-pack.js.map +1 -1
- package/dist/data-plane/server/indexing/plugins/status.d.ts +1 -1
- package/dist/data-plane/server/indexing/plugins/status.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/status.js.map +1 -1
- package/dist/data-plane/server/indexing/plugins/thread-gate.d.ts +1 -1
- package/dist/data-plane/server/indexing/plugins/thread-gate.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/thread-gate.js.map +1 -1
- package/dist/data-plane/server/indexing/plugins/verification.d.ts +1 -1
- package/dist/data-plane/server/indexing/plugins/verification.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/verification.js.map +1 -1
- package/dist/data-plane/server/indexing/processor.d.ts +1 -1
- package/dist/data-plane/server/indexing/processor.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/processor.js.map +1 -1
- package/dist/data-plane/server/routes/notifs.d.ts.map +1 -1
- package/dist/data-plane/server/routes/notifs.js +1 -8
- package/dist/data-plane/server/routes/notifs.js.map +1 -1
- package/dist/data-plane/server/routes/search.js +2 -2
- package/dist/data-plane/server/routes/search.js.map +1 -1
- package/dist/data-plane/server/subscription.d.ts +13 -12
- package/dist/data-plane/server/subscription.d.ts.map +1 -1
- package/dist/data-plane/server/subscription.js +59 -26
- package/dist/data-plane/server/subscription.js.map +1 -1
- package/dist/feature-gates/index.d.ts +2 -1
- package/dist/feature-gates/index.d.ts.map +1 -1
- package/dist/feature-gates/index.js +9 -6
- package/dist/feature-gates/index.js.map +1 -1
- package/dist/feature-gates/metrics.d.ts +3 -3
- package/dist/feature-gates/metrics.d.ts.map +1 -1
- package/dist/feature-gates/metrics.js +8 -8
- package/dist/feature-gates/metrics.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -7
- package/dist/index.js.map +1 -1
- package/dist/lexicons/app/bsky/notification/defs.defs.d.ts +5 -0
- package/dist/lexicons/app/bsky/notification/defs.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/notification/defs.defs.js +1 -0
- package/dist/lexicons/app/bsky/notification/defs.defs.js.map +1 -1
- package/dist/lexicons/chat/bsky/notification/defs.d.ts +2 -0
- package/dist/lexicons/chat/bsky/notification/defs.d.ts.map +1 -0
- package/dist/lexicons/chat/bsky/notification/defs.defs.d.ts +20 -0
- package/dist/lexicons/chat/bsky/notification/defs.defs.d.ts.map +1 -0
- package/dist/lexicons/chat/bsky/notification/defs.defs.js +19 -0
- package/dist/lexicons/chat/bsky/notification/defs.defs.js.map +1 -0
- package/dist/lexicons/chat/bsky/notification/defs.js +5 -0
- package/dist/lexicons/chat/bsky/notification/defs.js.map +1 -0
- package/dist/lexicons/chat/bsky/notification/getPreferences.d.ts +3 -0
- package/dist/lexicons/chat/bsky/notification/getPreferences.d.ts.map +1 -0
- package/dist/lexicons/chat/bsky/notification/getPreferences.defs.d.ts +18 -0
- package/dist/lexicons/chat/bsky/notification/getPreferences.defs.d.ts.map +1 -0
- package/dist/lexicons/chat/bsky/notification/getPreferences.defs.js +16 -0
- package/dist/lexicons/chat/bsky/notification/getPreferences.defs.js.map +1 -0
- package/dist/lexicons/chat/bsky/notification/getPreferences.js +6 -0
- package/dist/lexicons/chat/bsky/notification/getPreferences.js.map +1 -0
- package/dist/lexicons/chat/bsky/notification/putPreferences.d.ts +3 -0
- package/dist/lexicons/chat/bsky/notification/putPreferences.d.ts.map +1 -0
- package/dist/lexicons/chat/bsky/notification/putPreferences.defs.d.ts +27 -0
- package/dist/lexicons/chat/bsky/notification/putPreferences.defs.d.ts.map +1 -0
- package/dist/lexicons/chat/bsky/notification/putPreferences.defs.js +22 -0
- package/dist/lexicons/chat/bsky/notification/putPreferences.defs.js.map +1 -0
- package/dist/lexicons/chat/bsky/notification/putPreferences.js +6 -0
- package/dist/lexicons/chat/bsky/notification/putPreferences.js.map +1 -0
- package/dist/lexicons/chat/bsky/notification.d.ts +4 -0
- package/dist/lexicons/chat/bsky/notification.d.ts.map +1 -0
- package/dist/lexicons/chat/bsky/notification.js +7 -0
- package/dist/lexicons/chat/bsky/notification.js.map +1 -0
- package/dist/lexicons/chat/bsky.d.ts +1 -0
- package/dist/lexicons/chat/bsky.d.ts.map +1 -1
- package/dist/lexicons/chat/bsky.js +1 -0
- package/dist/lexicons/chat/bsky.js.map +1 -1
- package/dist/lexicons/tools/ozone/report/defs.defs.d.ts +4 -0
- package/dist/lexicons/tools/ozone/report/defs.defs.d.ts.map +1 -1
- package/dist/lexicons/tools/ozone/report/defs.defs.js +2 -0
- package/dist/lexicons/tools/ozone/report/defs.defs.js.map +1 -1
- package/dist/lexicons/tools/ozone/report/queryActivities.d.ts +3 -0
- package/dist/lexicons/tools/ozone/report/queryActivities.d.ts.map +1 -0
- package/dist/lexicons/tools/ozone/report/queryActivities.defs.d.ts +42 -0
- package/dist/lexicons/tools/ozone/report/queryActivities.defs.d.ts.map +1 -0
- package/dist/lexicons/tools/ozone/report/queryActivities.defs.js +31 -0
- package/dist/lexicons/tools/ozone/report/queryActivities.defs.js.map +1 -0
- package/dist/lexicons/tools/ozone/report/queryActivities.js +6 -0
- package/dist/lexicons/tools/ozone/report/queryActivities.js.map +1 -0
- package/dist/lexicons/tools/ozone/report.d.ts +1 -0
- package/dist/lexicons/tools/ozone/report.d.ts.map +1 -1
- package/dist/lexicons/tools/ozone/report.js +1 -0
- package/dist/lexicons/tools/ozone/report.js.map +1 -1
- package/dist/proto/bsky_pb.d.ts +47 -53
- package/dist/proto/bsky_pb.d.ts.map +1 -1
- package/dist/proto/bsky_pb.js +62 -71
- package/dist/proto/bsky_pb.js.map +1 -1
- package/package.json +10 -10
- package/proto/bsky.proto +19 -17
- package/src/api/app/bsky/actor/searchActorsTypeahead.ts +5 -3
- package/src/api/app/bsky/notification/putPreferencesV2.ts +4 -1
- package/src/api/app/bsky/notification/util.ts +7 -11
- package/src/api/blob-dispatcher.ts +12 -8
- package/src/api/blob-resolver.ts +0 -1
- package/src/data-plane/bsync/index.ts +12 -10
- package/src/data-plane/server/background.ts +49 -18
- package/src/data-plane/server/index.ts +12 -10
- package/src/data-plane/server/indexing/index.ts +1 -1
- package/src/data-plane/server/indexing/plugins/block.ts +4 -1
- package/src/data-plane/server/indexing/plugins/chat-declaration.ts +4 -1
- package/src/data-plane/server/indexing/plugins/feed-generator.ts +4 -1
- package/src/data-plane/server/indexing/plugins/follow.ts +4 -1
- package/src/data-plane/server/indexing/plugins/germ-declaration.ts +4 -1
- package/src/data-plane/server/indexing/plugins/labeler.ts +4 -1
- package/src/data-plane/server/indexing/plugins/like.ts +4 -1
- package/src/data-plane/server/indexing/plugins/list-block.ts +4 -1
- package/src/data-plane/server/indexing/plugins/list-item.ts +4 -1
- package/src/data-plane/server/indexing/plugins/list.ts +4 -1
- package/src/data-plane/server/indexing/plugins/notif-declaration.ts +4 -1
- package/src/data-plane/server/indexing/plugins/post-gate.ts +4 -1
- package/src/data-plane/server/indexing/plugins/post.ts +4 -1
- package/src/data-plane/server/indexing/plugins/profile.ts +4 -1
- package/src/data-plane/server/indexing/plugins/repost.ts +4 -1
- package/src/data-plane/server/indexing/plugins/starter-pack.ts +4 -1
- package/src/data-plane/server/indexing/plugins/status.ts +4 -1
- package/src/data-plane/server/indexing/plugins/thread-gate.ts +4 -1
- package/src/data-plane/server/indexing/plugins/verification.ts +4 -1
- package/src/data-plane/server/indexing/processor.ts +1 -1
- package/src/data-plane/server/routes/notifs.ts +0 -14
- package/src/data-plane/server/routes/search.ts +2 -2
- package/src/data-plane/server/subscription.ts +74 -31
- package/src/feature-gates/index.ts +10 -6
- package/src/feature-gates/metrics.test.ts +12 -12
- package/src/feature-gates/metrics.ts +8 -8
- package/src/index.ts +16 -9
- package/tests/_util.ts +8 -25
- package/tests/admin/admin-auth.test.ts +2 -2
- package/tests/admin/moderation.test.ts +1 -1
- package/tests/auth.test.ts +4 -6
- package/tests/blob-resolver.test.ts +4 -5
- package/tests/data-plane/db.test.ts +1 -1
- package/tests/data-plane/duplicate-records.test.ts +1 -1
- package/tests/data-plane/handle-invalidation.test.ts +2 -2
- package/tests/data-plane/indexing.test.ts +24 -21
- package/tests/data-plane/subscription.test.ts +1 -1
- package/tests/data-plane/thread-mutes.test.ts +2 -2
- package/tests/entryway-auth.test.ts +4 -5
- package/tests/feed-generation.test.ts +5 -5
- package/tests/image/server.test.ts +1 -1
- package/tests/label-hydration.test.ts +3 -5
- package/tests/postgates.test.ts +3 -6
- package/tests/query-labels.test.ts +3 -5
- package/tests/redis-cache.test.ts +1 -3
- package/tests/server.test.ts +11 -16
- package/tests/sitemap.test.ts +3 -4
- package/tests/stash.test.ts +12 -8
- package/tests/utils.test.ts +3 -13
- package/tests/views/account-deactivation.test.ts +3 -5
- package/tests/views/actor-likes.test.ts +3 -5
- package/tests/views/actor-search.test.ts +6 -7
- package/tests/views/age-assurance-v2.test.ts +9 -6
- package/tests/views/age-assurance.test.ts +30 -36
- package/tests/views/author-feed.test.ts +4 -6
- package/tests/views/block-lists.test.ts +3 -5
- package/tests/views/blocks.test.ts +3 -5
- package/tests/views/bookmarks.test.ts +4 -4
- package/tests/views/drafts.test.ts +7 -14
- package/tests/views/feed-hidden-replies.test.ts +3 -6
- package/tests/views/feed-view-post.test.ts +3 -6
- package/tests/views/follows.test.ts +4 -6
- package/tests/views/get-config.test.ts +4 -7
- package/tests/views/get-suggested-onboarding-users.test.ts +11 -9
- package/tests/views/get-suggested-starter-packs.test.ts +11 -9
- package/tests/views/get-trends.test.ts +15 -9
- package/tests/views/internal-actor.test.ts +3 -6
- package/tests/views/known-followers.test.ts +3 -6
- package/tests/views/labeler-service.test.ts +3 -5
- package/tests/views/labels-needs-review.test.ts +3 -6
- package/tests/views/labels-takedown.test.ts +3 -4
- package/tests/views/likes.test.ts +4 -6
- package/tests/views/list-feed.test.ts +3 -5
- package/tests/views/lists.test.ts +3 -5
- package/tests/views/mute-lists.test.ts +3 -5
- package/tests/views/mutes.test.ts +4 -5
- package/tests/views/notifications.test.ts +12 -11
- package/tests/views/post-search.test.ts +3 -24
- package/tests/views/posts-debug.test.ts +11 -6
- package/tests/views/posts.test.ts +3 -4
- package/tests/views/profile-debug.test.ts +11 -5
- package/tests/views/profile.test.ts +11 -5
- package/tests/views/quotes.test.ts +4 -6
- package/tests/views/reposts.test.ts +4 -6
- package/tests/views/starter-packs.test.ts +3 -6
- package/tests/views/suggestions.test.ts +9 -13
- package/tests/views/thread-v2.test.ts +3 -5
- package/tests/views/thread.test.ts +3 -7
- package/tests/views/threadgating.test.ts +3 -5
- package/tests/views/timeline.test.ts +4 -5
- package/tests/views/verification.test.ts +4 -6
- package/tsconfig.build.tsbuildinfo +1 -1
- package/vitest.config.ts +1 -0
|
@@ -2,7 +2,9 @@ import crypto from 'node:crypto'
|
|
|
2
2
|
import { once } from 'node:events'
|
|
3
3
|
import { Server, createServer } from 'node:http'
|
|
4
4
|
import { AddressInfo } from 'node:net'
|
|
5
|
-
import express, { Application } from 'express'
|
|
5
|
+
import express, { Application, RequestHandler } from 'express'
|
|
6
|
+
// eslint-disable-next-line import/default
|
|
7
|
+
import httpTerminator from 'http-terminator'
|
|
6
8
|
import {
|
|
7
9
|
afterAll,
|
|
8
10
|
afterEach,
|
|
@@ -41,8 +43,17 @@ describe('age assurance views', () => {
|
|
|
41
43
|
let actorDid: string
|
|
42
44
|
|
|
43
45
|
let kwsServer: MockKwsServer
|
|
44
|
-
|
|
45
|
-
const
|
|
46
|
+
|
|
47
|
+
const authMock = vi.fn<RequestHandler>((req, res) =>
|
|
48
|
+
res.json({
|
|
49
|
+
access_token:
|
|
50
|
+
'eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIn0.INVALID',
|
|
51
|
+
expires_in: 3600,
|
|
52
|
+
}),
|
|
53
|
+
)
|
|
54
|
+
const sendEmailMock = vi.fn<RequestHandler>((req, res) => {
|
|
55
|
+
res.json({})
|
|
56
|
+
})
|
|
46
57
|
|
|
47
58
|
beforeAll(async () => {
|
|
48
59
|
kwsServer = new MockKwsServer({
|
|
@@ -74,38 +85,24 @@ describe('age assurance views', () => {
|
|
|
74
85
|
agent = network.bsky.getAgent()
|
|
75
86
|
sc = network.getSeedClient()
|
|
76
87
|
await basicSeed(sc)
|
|
77
|
-
await network.processAll()
|
|
78
|
-
|
|
79
88
|
actorDid = sc.dids.alice
|
|
80
89
|
})
|
|
81
90
|
|
|
91
|
+
beforeEach(async () => network.processAll())
|
|
92
|
+
|
|
82
93
|
beforeEach(async () => {
|
|
83
|
-
//
|
|
84
|
-
authMock.
|
|
85
|
-
|
|
86
|
-
res.json({
|
|
87
|
-
access_token:
|
|
88
|
-
'eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIn0.INVALID',
|
|
89
|
-
expires_in: 3600,
|
|
90
|
-
}),
|
|
91
|
-
)
|
|
92
|
-
sendEmailMock.mockImplementation(
|
|
93
|
-
(_req: express.Request, res: express.Response) => {
|
|
94
|
-
res.json({})
|
|
95
|
-
},
|
|
96
|
-
)
|
|
94
|
+
// @TODO Use the clearMocks setting in the configuration instead of:
|
|
95
|
+
authMock.mockClear()
|
|
96
|
+
sendEmailMock.mockClear()
|
|
97
97
|
})
|
|
98
98
|
|
|
99
99
|
afterEach(async () => {
|
|
100
|
-
vi.resetAllMocks()
|
|
101
100
|
await clearPrivateData(db)
|
|
102
101
|
await clearActorAgeAssurance(db)
|
|
103
102
|
})
|
|
104
103
|
|
|
105
|
-
afterAll(async () =>
|
|
106
|
-
|
|
107
|
-
await kwsServer.stop()
|
|
108
|
-
})
|
|
104
|
+
afterAll(async () => network?.close())
|
|
105
|
+
afterAll(async () => kwsServer?.stop())
|
|
109
106
|
|
|
110
107
|
const getAgeAssurance = async (did: string) => {
|
|
111
108
|
const { data } = await agent.app.bsky.unspecced.getAgeAssuranceState(
|
|
@@ -372,13 +369,12 @@ const clearActorAgeAssurance = async (db: Database) => {
|
|
|
372
369
|
.execute()
|
|
373
370
|
}
|
|
374
371
|
|
|
375
|
-
type MockHandler = (req: express.Request, res: express.Response) => void
|
|
376
|
-
|
|
377
372
|
class MockKwsServer {
|
|
378
373
|
private verificationSecret: string
|
|
379
374
|
private webhookSecret: string
|
|
380
375
|
private app: Application
|
|
381
376
|
private server: Server
|
|
377
|
+
private terminator: httpTerminator.HttpTerminator
|
|
382
378
|
|
|
383
379
|
constructor({
|
|
384
380
|
verificationSecret,
|
|
@@ -388,21 +384,20 @@ class MockKwsServer {
|
|
|
388
384
|
}: {
|
|
389
385
|
verificationSecret: string
|
|
390
386
|
webhookSecret: string
|
|
391
|
-
authMock:
|
|
392
|
-
sendEmailMock:
|
|
387
|
+
authMock: RequestHandler
|
|
388
|
+
sendEmailMock: RequestHandler
|
|
393
389
|
}) {
|
|
394
390
|
this.verificationSecret = verificationSecret
|
|
395
391
|
this.webhookSecret = webhookSecret
|
|
396
392
|
|
|
397
393
|
this.app = express()
|
|
398
|
-
.post('/auth/realms/kws/protocol/openid-connect/token',
|
|
399
|
-
|
|
400
|
-
)
|
|
401
|
-
.post('/v1/verifications/send-email', (req, res) =>
|
|
402
|
-
sendEmailMock(req, res),
|
|
403
|
-
)
|
|
394
|
+
.post('/auth/realms/kws/protocol/openid-connect/token', authMock)
|
|
395
|
+
.post('/v1/verifications/send-email', sendEmailMock)
|
|
404
396
|
|
|
405
397
|
this.server = createServer(this.app)
|
|
398
|
+
this.terminator = httpTerminator.createHttpTerminator({
|
|
399
|
+
server: this.server,
|
|
400
|
+
})
|
|
406
401
|
}
|
|
407
402
|
|
|
408
403
|
async listen(port?: number) {
|
|
@@ -411,8 +406,7 @@ class MockKwsServer {
|
|
|
411
406
|
}
|
|
412
407
|
|
|
413
408
|
async stop() {
|
|
414
|
-
this.
|
|
415
|
-
await once(this.server, 'close')
|
|
409
|
+
await this.terminator.terminate()
|
|
416
410
|
}
|
|
417
411
|
|
|
418
412
|
callVerificationResponse(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import assert from 'node:assert'
|
|
2
|
-
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
|
2
|
+
import { afterAll, beforeAll, beforeEach, describe, expect, it } from 'vitest'
|
|
3
3
|
import {
|
|
4
4
|
AppBskyActorProfile,
|
|
5
5
|
AppBskyEmbedGallery,
|
|
@@ -46,18 +46,16 @@ describe('pds author feed views', () => {
|
|
|
46
46
|
pdsAgent = network.pds.getAgent()
|
|
47
47
|
sc = network.getSeedClient()
|
|
48
48
|
await authorFeedSeed(sc)
|
|
49
|
-
await network.processAll()
|
|
50
49
|
alice = sc.dids.alice
|
|
51
50
|
bob = sc.dids.bob
|
|
52
51
|
carol = sc.dids.carol
|
|
53
52
|
dan = sc.dids.dan
|
|
54
53
|
eve = sc.dids.eve
|
|
55
|
-
}, 20_000) // @NOTE seeding can take a while
|
|
56
|
-
|
|
57
|
-
afterAll(async () => {
|
|
58
|
-
await network.close()
|
|
59
54
|
})
|
|
60
55
|
|
|
56
|
+
beforeEach(async () => network.processAll())
|
|
57
|
+
afterAll(async () => network?.close())
|
|
58
|
+
|
|
61
59
|
// @TODO(bsky) blocked by actor takedown via labels.
|
|
62
60
|
// @TODO(bsky) blocked by record takedown via labels.
|
|
63
61
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
|
1
|
+
import { afterAll, beforeAll, beforeEach, describe, expect, it } from 'vitest'
|
|
2
2
|
import { AtUri, AtpAgent, ids } from '@atproto/api'
|
|
3
3
|
import { RecordRef, SeedClient, TestNetwork, basicSeed } from '@atproto/dev-env'
|
|
4
4
|
import { forSnapshot } from '../_util.js'
|
|
@@ -36,12 +36,10 @@ describe('pds views with blocking from block lists', () => {
|
|
|
36
36
|
sc.posts[dan][0].ref,
|
|
37
37
|
'alice replies to dan',
|
|
38
38
|
)
|
|
39
|
-
await network.processAll()
|
|
40
39
|
})
|
|
41
40
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
})
|
|
41
|
+
beforeEach(async () => network.processAll())
|
|
42
|
+
afterAll(async () => network?.close())
|
|
45
43
|
|
|
46
44
|
let listUri: string
|
|
47
45
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import assert from 'node:assert'
|
|
2
|
-
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
|
2
|
+
import { afterAll, beforeAll, beforeEach, describe, expect, it } from 'vitest'
|
|
3
3
|
import {
|
|
4
4
|
AppBskyEmbedRecord,
|
|
5
5
|
AppBskyFeedDefs,
|
|
@@ -65,12 +65,10 @@ describe('pds views with blocking', () => {
|
|
|
65
65
|
sc.getHeaders(dan),
|
|
66
66
|
)
|
|
67
67
|
danBlockUri = danBlockCarol.uri
|
|
68
|
-
await network.processAll()
|
|
69
68
|
})
|
|
70
69
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
})
|
|
70
|
+
beforeEach(async () => network.processAll())
|
|
71
|
+
afterAll(async () => network?.close())
|
|
74
72
|
|
|
75
73
|
it('blocks thread post', async () => {
|
|
76
74
|
const { data: threadAlice } = await agent.api.app.bsky.feed.getPostThread(
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
afterAll,
|
|
4
4
|
afterEach,
|
|
5
5
|
beforeAll,
|
|
6
|
+
beforeEach,
|
|
6
7
|
describe,
|
|
7
8
|
expect,
|
|
8
9
|
it,
|
|
@@ -43,7 +44,6 @@ describe('appview bookmarks views', () => {
|
|
|
43
44
|
agent = network.bsky.getAgent()
|
|
44
45
|
sc = network.getSeedClient()
|
|
45
46
|
await basicSeed(sc)
|
|
46
|
-
await network.processAll()
|
|
47
47
|
|
|
48
48
|
alice = sc.dids.alice
|
|
49
49
|
bob = sc.dids.bob
|
|
@@ -51,15 +51,15 @@ describe('appview bookmarks views', () => {
|
|
|
51
51
|
dan = sc.dids.dan
|
|
52
52
|
})
|
|
53
53
|
|
|
54
|
+
beforeEach(async () => network.processAll())
|
|
55
|
+
|
|
54
56
|
afterEach(async () => {
|
|
55
57
|
vi.resetAllMocks()
|
|
56
58
|
await clearPrivateData(db)
|
|
57
59
|
await clearBookmarks(db)
|
|
58
60
|
})
|
|
59
61
|
|
|
60
|
-
afterAll(async () =>
|
|
61
|
-
await network.close()
|
|
62
|
-
})
|
|
62
|
+
afterAll(async () => network?.close())
|
|
63
63
|
|
|
64
64
|
const get = async (actor: string, limit?: number, cursor?: string) =>
|
|
65
65
|
agent.app.bsky.bookmark.getBookmarks(
|
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
afterAll,
|
|
3
3
|
afterEach,
|
|
4
4
|
beforeAll,
|
|
5
|
+
beforeEach,
|
|
5
6
|
describe,
|
|
6
7
|
expect,
|
|
7
8
|
it,
|
|
@@ -16,7 +17,7 @@ import {
|
|
|
16
17
|
ids,
|
|
17
18
|
} from '@atproto/api'
|
|
18
19
|
import { TID } from '@atproto/common'
|
|
19
|
-
import {
|
|
20
|
+
import { TestNetwork, basicSeed } from '@atproto/dev-env'
|
|
20
21
|
import { paginateAll } from '../_util.js'
|
|
21
22
|
|
|
22
23
|
type Database = TestNetwork['bsky']['db']
|
|
@@ -26,8 +27,6 @@ const LIMIT = 10
|
|
|
26
27
|
describe('appview drafts views', () => {
|
|
27
28
|
let network: TestNetwork
|
|
28
29
|
let agent: AtpAgent
|
|
29
|
-
let sc: SeedClient
|
|
30
|
-
let db: Database
|
|
31
30
|
|
|
32
31
|
// account dids, for convenience
|
|
33
32
|
let alice: string
|
|
@@ -40,24 +39,18 @@ describe('appview drafts views', () => {
|
|
|
40
39
|
draftsLimit: LIMIT,
|
|
41
40
|
},
|
|
42
41
|
})
|
|
43
|
-
db = network.bsky.db
|
|
44
42
|
agent = network.bsky.getAgent()
|
|
45
|
-
sc = network.getSeedClient()
|
|
43
|
+
const sc = network.getSeedClient()
|
|
46
44
|
await basicSeed(sc)
|
|
47
|
-
await network.processAll()
|
|
48
45
|
|
|
49
46
|
alice = sc.dids.alice
|
|
50
47
|
bob = sc.dids.bob
|
|
51
48
|
})
|
|
52
49
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
afterAll(async () => {
|
|
59
|
-
await network.close()
|
|
60
|
-
})
|
|
50
|
+
beforeEach(async () => network.processAll())
|
|
51
|
+
afterEach(async () => vi.resetAllMocks())
|
|
52
|
+
afterEach(async () => clearDrafts(network.bsky.db))
|
|
53
|
+
afterAll(async () => network?.close())
|
|
61
54
|
|
|
62
55
|
const makeDraft = (): AppBskyDraftDefs.Draft => ({
|
|
63
56
|
posts: [{ text: 'Hello, world!' }],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
|
1
|
+
import { afterAll, beforeAll, beforeEach, describe, expect, it } from 'vitest'
|
|
2
2
|
import { AtpAgent, ids } from '@atproto/api'
|
|
3
3
|
import { SeedClient, TestNetwork } from '@atproto/dev-env'
|
|
4
4
|
import { Users, feedHiddenRepliesSeed } from '../seed/feed-hidden-replies.js'
|
|
@@ -20,13 +20,10 @@ describe('feed hidden replies', () => {
|
|
|
20
20
|
|
|
21
21
|
const result = await feedHiddenRepliesSeed(sc)
|
|
22
22
|
users = result.users
|
|
23
|
-
|
|
24
|
-
await network.processAll()
|
|
25
23
|
})
|
|
26
24
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
})
|
|
25
|
+
beforeEach(async () => network.processAll())
|
|
26
|
+
afterAll(async () => network?.close())
|
|
30
27
|
|
|
31
28
|
describe(`notifications`, () => {
|
|
32
29
|
it(`[A] -> [B] : B is hidden`, async () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import assert from 'node:assert'
|
|
2
|
-
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
|
2
|
+
import { afterAll, beforeAll, beforeEach, describe, expect, it } from 'vitest'
|
|
3
3
|
import { AppBskyFeedDefs, AtUri, AtpAgent, ids } from '@atproto/api'
|
|
4
4
|
import { SeedClient, TestNetwork, basicSeed } from '@atproto/dev-env'
|
|
5
5
|
|
|
@@ -47,13 +47,10 @@ describe('pds thread views', () => {
|
|
|
47
47
|
await sc.follow(dan, alice)
|
|
48
48
|
await sc.follow(dan, bob)
|
|
49
49
|
await sc.follow(dan, carol)
|
|
50
|
-
|
|
51
|
-
await network.processAll()
|
|
52
50
|
})
|
|
53
51
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
})
|
|
52
|
+
beforeEach(async () => network.processAll())
|
|
53
|
+
afterAll(async () => network?.close())
|
|
57
54
|
|
|
58
55
|
it(`[A] -> [B], A blocks B, viewed as C`, async () => {
|
|
59
56
|
const A = await sc.post(alice, `A`)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
|
1
|
+
import { afterAll, beforeAll, beforeEach, describe, expect, it } from 'vitest'
|
|
2
2
|
import {
|
|
3
3
|
AppBskyGraphGetFollowers,
|
|
4
4
|
AppBskyGraphGetFollows,
|
|
@@ -23,14 +23,12 @@ describe('pds follow views', () => {
|
|
|
23
23
|
agent = network.bsky.getAgent()
|
|
24
24
|
sc = network.getSeedClient()
|
|
25
25
|
await followsSeed(sc)
|
|
26
|
-
await network.processAll()
|
|
27
26
|
alice = sc.dids.alice
|
|
28
|
-
}, 20_000) // @NOTE seeding can take a while
|
|
29
|
-
|
|
30
|
-
afterAll(async () => {
|
|
31
|
-
await network.close()
|
|
32
27
|
})
|
|
33
28
|
|
|
29
|
+
beforeEach(async () => network.processAll())
|
|
30
|
+
afterAll(async () => network?.close())
|
|
31
|
+
|
|
34
32
|
// TODO(bsky) blocks followers by actor takedown via labels
|
|
35
33
|
// TODO(bsky) blocks follows by actor takedown via labels
|
|
36
34
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
|
1
|
+
import { afterAll, beforeAll, beforeEach, describe, expect, it } from 'vitest'
|
|
2
2
|
import AtpAgent from '@atproto/api'
|
|
3
3
|
import { TestNetwork } from '@atproto/dev-env'
|
|
4
4
|
|
|
@@ -12,13 +12,10 @@ describe('get config', () => {
|
|
|
12
12
|
dbPostgresSchema: 'bsky_tests_live_now_config_off',
|
|
13
13
|
})
|
|
14
14
|
agent = network.bsky.getAgent()
|
|
15
|
-
|
|
16
|
-
await network.processAll()
|
|
17
15
|
})
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
})
|
|
17
|
+
beforeEach(async () => network.processAll())
|
|
18
|
+
afterAll(async () => network?.close())
|
|
22
19
|
|
|
23
20
|
it('omits the live now config', async () => {
|
|
24
21
|
const res = await agent.app.bsky.unspecced.getConfig()
|
|
@@ -55,7 +52,7 @@ describe('get config', () => {
|
|
|
55
52
|
})
|
|
56
53
|
|
|
57
54
|
afterAll(async () => {
|
|
58
|
-
await network
|
|
55
|
+
await network?.close()
|
|
59
56
|
})
|
|
60
57
|
|
|
61
58
|
it(`returns the config`, async () => {
|
|
@@ -2,7 +2,9 @@ import { once } from 'node:events'
|
|
|
2
2
|
import { Server, createServer } from 'node:http'
|
|
3
3
|
import { AddressInfo } from 'node:net'
|
|
4
4
|
import express, { Application } from 'express'
|
|
5
|
-
|
|
5
|
+
// eslint-disable-next-line import/default
|
|
6
|
+
import httpTerminator from 'http-terminator'
|
|
7
|
+
import { afterAll, beforeAll, beforeEach, describe, expect, it } from 'vitest'
|
|
6
8
|
import {
|
|
7
9
|
AppBskyUnspeccedGetOnboardingSuggestedUsersSkeleton,
|
|
8
10
|
AtpAgent,
|
|
@@ -83,14 +85,11 @@ describe('getSuggestedOnboardingUsers', () => {
|
|
|
83
85
|
|
|
84
86
|
const result = await seed(sc)
|
|
85
87
|
seededUsers = result.users
|
|
86
|
-
|
|
87
|
-
await network.processAll()
|
|
88
88
|
})
|
|
89
89
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
})
|
|
90
|
+
beforeEach(async () => network.processAll())
|
|
91
|
+
afterAll(async () => network?.close())
|
|
92
|
+
afterAll(async () => mockServer?.stop())
|
|
94
93
|
|
|
95
94
|
describe(`basic handling`, () => {
|
|
96
95
|
beforeAll(() => {
|
|
@@ -150,12 +149,16 @@ describe('getSuggestedOnboardingUsers', () => {
|
|
|
150
149
|
class MockServer {
|
|
151
150
|
app: Application
|
|
152
151
|
server: Server
|
|
152
|
+
terminator: httpTerminator.HttpTerminator
|
|
153
153
|
|
|
154
154
|
mockedDids = new Map<string, string>()
|
|
155
155
|
|
|
156
156
|
constructor() {
|
|
157
157
|
this.app = this.createApp()
|
|
158
158
|
this.server = createServer(this.app)
|
|
159
|
+
this.terminator = httpTerminator.createHttpTerminator({
|
|
160
|
+
server: this.server,
|
|
161
|
+
})
|
|
159
162
|
}
|
|
160
163
|
|
|
161
164
|
async listen(port?: number) {
|
|
@@ -164,8 +167,7 @@ class MockServer {
|
|
|
164
167
|
}
|
|
165
168
|
|
|
166
169
|
async stop() {
|
|
167
|
-
this.
|
|
168
|
-
await once(this.server, 'close')
|
|
170
|
+
await this.terminator.terminate()
|
|
169
171
|
}
|
|
170
172
|
|
|
171
173
|
get url() {
|
|
@@ -2,7 +2,9 @@ import { once } from 'node:events'
|
|
|
2
2
|
import { Server, createServer } from 'node:http'
|
|
3
3
|
import { AddressInfo } from 'node:net'
|
|
4
4
|
import express, { Application } from 'express'
|
|
5
|
-
|
|
5
|
+
// eslint-disable-next-line import/default
|
|
6
|
+
import httpTerminator from 'http-terminator'
|
|
7
|
+
import { afterAll, beforeAll, beforeEach, describe, expect, it } from 'vitest'
|
|
6
8
|
import {
|
|
7
9
|
AppBskyUnspeccedGetSuggestedStarterPacksSkeleton,
|
|
8
10
|
AtpAgent,
|
|
@@ -40,14 +42,11 @@ describe('getSuggestedStarterPacks', () => {
|
|
|
40
42
|
const result = await starterPacksSeed(sc)
|
|
41
43
|
users = result.users
|
|
42
44
|
starterpacks = result.starterpacks
|
|
43
|
-
|
|
44
|
-
await network.processAll()
|
|
45
45
|
})
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
})
|
|
47
|
+
beforeEach(async () => network.processAll())
|
|
48
|
+
afterAll(async () => network?.close())
|
|
49
|
+
afterAll(async () => mockServer?.stop())
|
|
51
50
|
|
|
52
51
|
describe(`basic handling`, () => {
|
|
53
52
|
beforeAll(() => {
|
|
@@ -92,6 +91,7 @@ describe('getSuggestedStarterPacks', () => {
|
|
|
92
91
|
class MockServer {
|
|
93
92
|
app: Application
|
|
94
93
|
server: Server
|
|
94
|
+
terminator: httpTerminator.HttpTerminator
|
|
95
95
|
|
|
96
96
|
mockedStarterPackUris = new Map<
|
|
97
97
|
string,
|
|
@@ -101,6 +101,9 @@ class MockServer {
|
|
|
101
101
|
constructor() {
|
|
102
102
|
this.app = this.createApp()
|
|
103
103
|
this.server = createServer(this.app)
|
|
104
|
+
this.terminator = httpTerminator.createHttpTerminator({
|
|
105
|
+
server: this.server,
|
|
106
|
+
})
|
|
104
107
|
}
|
|
105
108
|
|
|
106
109
|
async listen(port?: number) {
|
|
@@ -109,8 +112,7 @@ class MockServer {
|
|
|
109
112
|
}
|
|
110
113
|
|
|
111
114
|
async stop() {
|
|
112
|
-
this.
|
|
113
|
-
await once(this.server, 'close')
|
|
115
|
+
await this.terminator.terminate()
|
|
114
116
|
}
|
|
115
117
|
|
|
116
118
|
get url() {
|
|
@@ -3,7 +3,9 @@ import { once } from 'node:events'
|
|
|
3
3
|
import { Server, createServer } from 'node:http'
|
|
4
4
|
import { AddressInfo } from 'node:net'
|
|
5
5
|
import express, { Application } from 'express'
|
|
6
|
-
|
|
6
|
+
// eslint-disable-next-line import/default
|
|
7
|
+
import httpTerminator from 'http-terminator'
|
|
8
|
+
import { afterAll, beforeAll, beforeEach, describe, expect, it } from 'vitest'
|
|
7
9
|
import { AppBskyUnspeccedGetTrendsSkeleton, AtpAgent, ids } from '@atproto/api'
|
|
8
10
|
import { SeedClient, TestNetwork } from '@atproto/dev-env'
|
|
9
11
|
import { Users, trendsSeed } from '../seed/get-trends.js'
|
|
@@ -31,14 +33,11 @@ describe('getTrends', () => {
|
|
|
31
33
|
|
|
32
34
|
const result = await trendsSeed(sc)
|
|
33
35
|
users = result.users
|
|
34
|
-
|
|
35
|
-
await network.processAll()
|
|
36
36
|
})
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
})
|
|
38
|
+
beforeEach(async () => network.processAll())
|
|
39
|
+
afterAll(async () => network?.close())
|
|
40
|
+
afterAll(async () => mockTrendServer?.stop())
|
|
42
41
|
|
|
43
42
|
describe(`basic handling`, () => {
|
|
44
43
|
beforeAll(() => {
|
|
@@ -96,6 +95,7 @@ describe('getTrends', () => {
|
|
|
96
95
|
class MockTrendsServer {
|
|
97
96
|
app: Application
|
|
98
97
|
server: Server
|
|
98
|
+
terminator: httpTerminator.HttpTerminator
|
|
99
99
|
|
|
100
100
|
mockedTrendSkeletons = new Map<
|
|
101
101
|
string,
|
|
@@ -105,6 +105,9 @@ class MockTrendsServer {
|
|
|
105
105
|
constructor() {
|
|
106
106
|
this.app = this.createApp()
|
|
107
107
|
this.server = createServer(this.app)
|
|
108
|
+
this.terminator = httpTerminator.createHttpTerminator({
|
|
109
|
+
server: this.server,
|
|
110
|
+
})
|
|
108
111
|
}
|
|
109
112
|
|
|
110
113
|
async listen(port?: number) {
|
|
@@ -113,8 +116,11 @@ class MockTrendsServer {
|
|
|
113
116
|
}
|
|
114
117
|
|
|
115
118
|
async stop() {
|
|
116
|
-
this.
|
|
117
|
-
|
|
119
|
+
await this.terminator.terminate()
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
async [Symbol.asyncDispose]() {
|
|
123
|
+
await this.stop()
|
|
118
124
|
}
|
|
119
125
|
|
|
120
126
|
get url() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
|
1
|
+
import { afterAll, beforeAll, beforeEach, describe, expect, it } from 'vitest'
|
|
2
2
|
import { AppBskyActorDefs, AtpAgent } from '@atproto/api'
|
|
3
3
|
import { SeedClient, TestNetwork } from '@atproto/dev-env'
|
|
4
4
|
import { knownFollowersSeed } from '../seed/known-followers.js'
|
|
@@ -35,13 +35,10 @@ describe('internal actor views', () => {
|
|
|
35
35
|
{ createdAt: new Date().toISOString(), subject: dids.mix_sp_block_res },
|
|
36
36
|
seedClient.getHeaders(dids.mix_sub_1),
|
|
37
37
|
)
|
|
38
|
-
|
|
39
|
-
await network.processAll()
|
|
40
38
|
})
|
|
41
39
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
})
|
|
40
|
+
beforeEach(async () => network.processAll())
|
|
41
|
+
afterAll(async () => network?.close())
|
|
45
42
|
|
|
46
43
|
describe('getProfiles', () => {
|
|
47
44
|
const getProfiles = async (
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
|
1
|
+
import { afterAll, beforeAll, beforeEach, describe, expect, it } from 'vitest'
|
|
2
2
|
import { AtpAgent, ids } from '@atproto/api'
|
|
3
3
|
import { SeedClient, TestNetwork } from '@atproto/dev-env'
|
|
4
4
|
import { knownFollowersSeed } from '../seed/known-followers.js'
|
|
@@ -54,13 +54,10 @@ describe('known followers (social proof)', () => {
|
|
|
54
54
|
{ createdAt: new Date().toISOString(), subject: dids.mix_sp_block_res },
|
|
55
55
|
seedClient.getHeaders(dids.mix_sub_1),
|
|
56
56
|
)
|
|
57
|
-
|
|
58
|
-
await network.processAll()
|
|
59
57
|
})
|
|
60
58
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
})
|
|
59
|
+
beforeEach(async () => network.processAll())
|
|
60
|
+
afterAll(async () => network?.close())
|
|
64
61
|
|
|
65
62
|
/*
|
|
66
63
|
* Note that this test arbitrarily uses `getFollows` bc atm it returns
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import assert from 'node:assert'
|
|
2
|
-
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
|
2
|
+
import { afterAll, beforeAll, beforeEach, describe, expect, it } from 'vitest'
|
|
3
3
|
import {
|
|
4
4
|
AppBskyEmbedRecord,
|
|
5
5
|
AppBskyLabelerDefs,
|
|
@@ -67,12 +67,10 @@ describe('labeler service views', () => {
|
|
|
67
67
|
aliceService = new RecordRef(aliceRes.data.uri, aliceRes.data.cid)
|
|
68
68
|
|
|
69
69
|
await sc.like(bob, aliceService)
|
|
70
|
-
await network.processAll()
|
|
71
70
|
})
|
|
72
71
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
})
|
|
72
|
+
beforeEach(async () => network.processAll())
|
|
73
|
+
afterAll(async () => network?.close())
|
|
76
74
|
|
|
77
75
|
it('fetches labelers', async () => {
|
|
78
76
|
const view = await agent.api.app.bsky.labeler.getServices(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import assert from 'node:assert'
|
|
2
|
-
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
|
2
|
+
import { afterAll, beforeAll, beforeEach, describe, expect, it } from 'vitest'
|
|
3
3
|
import { AppBskyFeedDefs, AtpAgent, ids } from '@atproto/api'
|
|
4
4
|
import { SeedClient, TestNetwork, basicSeed } from '@atproto/dev-env'
|
|
5
5
|
|
|
@@ -39,14 +39,11 @@ describe('bsky needs-review labels', () => {
|
|
|
39
39
|
|
|
40
40
|
await sc.follow(sc.dids.bob, sc.dids.geoff)
|
|
41
41
|
|
|
42
|
-
await network.processAll()
|
|
43
|
-
|
|
44
42
|
AtpAgent.configure({ appLabelers: [network.ozone.ctx.cfg.service.did] })
|
|
45
43
|
})
|
|
46
44
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
})
|
|
45
|
+
beforeEach(async () => network.processAll())
|
|
46
|
+
afterAll(async () => network?.close())
|
|
50
47
|
|
|
51
48
|
describe('account-level', () => {
|
|
52
49
|
beforeAll(async () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import assert from 'node:assert'
|
|
2
|
-
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
|
2
|
+
import { afterAll, beforeAll, beforeEach, describe, expect, it } from 'vitest'
|
|
3
3
|
import { AppBskyLabelerDefs, AtpAgent, ids } from '@atproto/api'
|
|
4
4
|
import { RecordRef, SeedClient, TestNetwork, basicSeed } from '@atproto/dev-env'
|
|
5
5
|
|
|
@@ -131,9 +131,8 @@ describe('bsky takedown labels', () => {
|
|
|
131
131
|
await network.bsky.db.db.insertInto('label').values(labels).execute()
|
|
132
132
|
})
|
|
133
133
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
})
|
|
134
|
+
beforeEach(async () => network.processAll())
|
|
135
|
+
afterAll(async () => network?.close())
|
|
137
136
|
|
|
138
137
|
it('takesdown profiles', async () => {
|
|
139
138
|
const attempt = agent.api.app.bsky.actor.getProfile({
|