Skip to content

Commit

Permalink
fix testing
Browse files Browse the repository at this point in the history
  • Loading branch information
0marSalah committed Dec 5, 2024
1 parent 7207561 commit dc9b76e
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 94 deletions.
Binary file modified out/test-export-2024-01-01.tar
Binary file not shown.
188 changes: 95 additions & 93 deletions test/fixtures/outbox.ts
Original file line number Diff line number Diff line change
@@ -1,99 +1,101 @@
export const outbox = {
"@context": "https://www.w3.org/ns/activitystreams",
"id": "outbox.json",
"type": "OrderedCollection",
"totalItems": 3,
"orderedItems": [
{
"@context": "https://www.w3.org/ns/activitystreams",
"id": "https://example.com/users/alice/statuses/109407353983685867/activity",
"type": "Announce",
"actor": "https://example.com/users/alice",
"published": "2022-11-26T00:48:56Z",
"to": [
"https://www.w3.org/ns/activitystreams#Public"
],
"cc": [
"https://mastodon.social/users/bobwyman",
"https://example.com/users/alice/followers"
],
"object": "https://mastodon.social/users/bobwyman/statuses/109399822260648081"
},
{
"@context": "https://www.w3.org/ns/activitystreams",
"id": "https://example.com/users/alice/statuses/109412389200730237/activity",
"type": "Announce",
"actor": "https://example.com/users/alice",
"published": "2022-11-26T22:09:27Z",
"to": [
"https://www.w3.org/ns/activitystreams#Public"
],
"cc": [
"https://omfg.town/users/dansinker",
"https://example.com/users/alice/followers"
],
"object": "https://omfg.town/users/dansinker/statuses/109411849664571485"
},
{
"id": "https://example.com/users/alice/statuses/109419229622587183/activity",
"type": "Create",
"actor": "https://example.com/users/alice",
"published": "2022-11-28T03:09:04Z",
"to": [
"https://www.w3.org/ns/activitystreams#Public"
],
"cc": [
"https://example.com/users/alice/followers",
"https://mindly.social/users/djdellamorte"
],
"object": {
"id": "https://example.com/users/alice/statuses/109419229622587183",
"type": "Note",
"summary": null,
"inReplyTo": "https://mindly.social/users/djdellamorte/statuses/109417853187485668",
"published": "2022-11-28T03:09:04Z",
"url": "https://example.com/@alice/109419229622587183",
"attributedTo": "https://example.com/users/alice",
"to": [
"https://www.w3.org/ns/activitystreams#Public"
export const outbox = [
{
'@context': 'https://www.w3.org/ns/activitystreams',
id: 'outbox.json',
type: 'OrderedCollection',
totalItems: 3,
orderedItems: [
{
'@context': 'https://www.w3.org/ns/activitystreams',
id: 'https://example.com/users/alice/statuses/109407353983685867/activity',
type: 'Announce',
actor: 'https://example.com/users/alice',
published: '2022-11-26T00:48:56Z',
to: ['https://www.w3.org/ns/activitystreams#Public'],
cc: [
'https://mastodon.social/users/bobwyman',
'https://example.com/users/alice/followers'
],
"cc": [
"https://example.com/users/alice/followers",
"https://mindly.social/users/djdellamorte"
object:
'https://mastodon.social/users/bobwyman/statuses/109399822260648081'
},
{
'@context': 'https://www.w3.org/ns/activitystreams',
id: 'https://example.com/users/alice/statuses/109412389200730237/activity',
type: 'Announce',
actor: 'https://example.com/users/alice',
published: '2022-11-26T22:09:27Z',
to: ['https://www.w3.org/ns/activitystreams#Public'],
cc: [
'https://omfg.town/users/dansinker',
'https://example.com/users/alice/followers'
],
"sensitive": false,
"atomUri": "https://example.com/users/alice/statuses/109419229622587183",
"inReplyToAtomUri": "https://mindly.social/users/djdellamorte/statuses/109417853187485668",
"conversation": "tag:mindly.social,2022-11-27:objectId=5397243:objectType=Conversation",
"content": "<p><span class=\"h-card\"><a href=\"https://mindly.social/@djdellamorte\" class=\"u-url mention\">@<span>djdellamorte</span></a></span> I see them used a lot as a teleprompter, when recording videos or podcasts.</p>",
"contentMap": {
"en": "<p><span class=\"h-card\"><a href=\"https://mindly.social/@djdellamorte\" class=\"u-url mention\">@<span>djdellamorte</span></a></span> I see them used a lot as a teleprompter, when recording videos or podcasts.</p>"
},
"attachment": [],
"tag": [
{
"type": "Mention",
"href": "https://mindly.social/users/djdellamorte",
"name": "@[email protected]"
}
object: 'https://omfg.town/users/dansinker/statuses/109411849664571485'
},
{
id: 'https://example.com/users/alice/statuses/109419229622587183/activity',
type: 'Create',
actor: 'https://example.com/users/alice',
published: '2022-11-28T03:09:04Z',
to: ['https://www.w3.org/ns/activitystreams#Public'],
cc: [
'https://example.com/users/alice/followers',
'https://mindly.social/users/djdellamorte'
],
"replies": {
"id": "https://example.com/users/alice/statuses/109419229622587183/replies",
"type": "Collection",
"first": {
"type": "CollectionPage",
"next": "https://example.com/users/alice/statuses/109419229622587183/replies?only_other_accounts=true&page=true",
"partOf": "https://example.com/users/alice/statuses/109419229622587183/replies",
"items": []
object: {
id: 'https://example.com/users/alice/statuses/109419229622587183',
type: 'Note',
summary: null,
inReplyTo:
'https://mindly.social/users/djdellamorte/statuses/109417853187485668',
published: '2022-11-28T03:09:04Z',
url: 'https://example.com/@alice/109419229622587183',
attributedTo: 'https://example.com/users/alice',
to: ['https://www.w3.org/ns/activitystreams#Public'],
cc: [
'https://example.com/users/alice/followers',
'https://mindly.social/users/djdellamorte'
],
sensitive: false,
atomUri:
'https://example.com/users/alice/statuses/109419229622587183',
inReplyToAtomUri:
'https://mindly.social/users/djdellamorte/statuses/109417853187485668',
conversation:
'tag:mindly.social,2022-11-27:objectId=5397243:objectType=Conversation',
content:
'<p><span class="h-card"><a href="https://mindly.social/@djdellamorte" class="u-url mention">@<span>djdellamorte</span></a></span> I see them used a lot as a teleprompter, when recording videos or podcasts.</p>',
contentMap: {
en: '<p><span class="h-card"><a href="https://mindly.social/@djdellamorte" class="u-url mention">@<span>djdellamorte</span></a></span> I see them used a lot as a teleprompter, when recording videos or podcasts.</p>'
},
attachment: [],
tag: [
{
type: 'Mention',
href: 'https://mindly.social/users/djdellamorte',
name: '@[email protected]'
}
],
replies: {
id: 'https://example.com/users/alice/statuses/109419229622587183/replies',
type: 'Collection',
first: {
type: 'CollectionPage',
next: 'https://example.com/users/alice/statuses/109419229622587183/replies?only_other_accounts=true&page=true',
partOf:
'https://example.com/users/alice/statuses/109419229622587183/replies',
items: []
}
}
},
signature: {
type: 'RsaSignature2017',
creator: 'https://example.com/users/alice#main-key',
created: '2023-05-09T02:46:04Z',
signatureValue:
'eLb+AzyjDei4G6MkRlw/CCxObyWS+dMAo+8NlvPATt9xjud+KLSq8oc9vaSEYk+3uovw5XfdVdlFF+FAgq1kDGJJfGq4xOVpm8JzLtqbMsEfB6BFAEGyCvO8iQD9pFhNRrzZOKoznKrnFjLnItbv9eyNefZISEqHRuO6wHcfTvuPGrChwNPg9FKUQaSvB1wx9KShgypzcQbZA5BMXhJSQGcIIZXGa2GenXi6brGlIorFxb5nNtJnGpn2kxKHQpcfFsA4L2q/sIzVYTPO+O/KyLtjWIaITHm0R1SeToGK47M/yOR3a/7oh/r/5ncKornLnTwKW+EBn41E8cxMnHIZsw=='
}
},
"signature": {
"type": "RsaSignature2017",
"creator": "https://example.com/users/alice#main-key",
"created": "2023-05-09T02:46:04Z",
"signatureValue": "eLb+AzyjDei4G6MkRlw/CCxObyWS+dMAo+8NlvPATt9xjud+KLSq8oc9vaSEYk+3uovw5XfdVdlFF+FAgq1kDGJJfGq4xOVpm8JzLtqbMsEfB6BFAEGyCvO8iQD9pFhNRrzZOKoznKrnFjLnItbv9eyNefZISEqHRuO6wHcfTvuPGrChwNPg9FKUQaSvB1wx9KShgypzcQbZA5BMXhJSQGcIIZXGa2GenXi6brGlIorFxb5nNtJnGpn2kxKHQpcfFsA4L2q/sIzVYTPO+O/KyLtjWIaITHm0R1SeToGK47M/yOR3a/7oh/r/5ncKornLnTwKW+EBn41E8cxMnHIZsw=="
}
},
]
}
]
}
]
2 changes: 1 addition & 1 deletion test/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('exportActorProfile', () => {
it('calls function', async () => {
const filename = 'out/test-export-2024-01-01.tar'
const tarball = fs.createWriteStream(filename)
const packStream = exportActorProfile({ actorProfile, outbox })
const packStream = await exportActorProfile({ actorProfile, outbox })

packStream.pipe(tarball)
})
Expand Down

0 comments on commit dc9b76e

Please sign in to comment.