remove publishedFromNow, its static so useless!
This commit is contained in:
parent
782b1edd53
commit
7bdd377b43
|
@ -16,7 +16,6 @@ async function getWebmentions(domain) {
|
||||||
const json = JSON.parse(result.body).json
|
const json = JSON.parse(result.body).json
|
||||||
|
|
||||||
json.forEach(mention => {
|
json.forEach(mention => {
|
||||||
mention.publishedFromNow = dayjs(mention.published).fromNow()
|
|
||||||
mention.relativeTarget = mention.target.substring(mention.target.indexOf(domain) + domain.length, mention.target.length)
|
mention.relativeTarget = mention.target.substring(mention.target.indexOf(domain) + domain.length, mention.target.length)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -21,14 +21,6 @@ describe("webmention receive serve-my-jam tests", () => {
|
||||||
expect(mention.target).toEqual("https://brainbaking.com/post/2021/02/my-retro-desktop-setup/")
|
expect(mention.target).toEqual("https://brainbaking.com/post/2021/02/my-retro-desktop-setup/")
|
||||||
})
|
})
|
||||||
|
|
||||||
test("getWebmentions enriches data with fromNow data", async () => {
|
|
||||||
const result = await getWebmentions(domain)
|
|
||||||
const mention = result[0]
|
|
||||||
|
|
||||||
expect(mention.published).toEqual("2021-03-08T18:35:24")
|
|
||||||
expect(mention.publishedFromNow).toEqual("3 days ago")
|
|
||||||
})
|
|
||||||
|
|
||||||
test("getWebmentions are sorted by published date descending", async() => {
|
test("getWebmentions are sorted by published date descending", async() => {
|
||||||
const result = await getWebmentions(domain)
|
const result = await getWebmentions(domain)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue