WIP Tags
This commit is contained in:
@@ -47,6 +47,16 @@ describe("Article", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("#tags", () => {
|
||||
it("returns a flattened tag list", () => {
|
||||
expect(article.tags).toEqual([
|
||||
"lightning",
|
||||
"lightning network",
|
||||
"howto",
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("#publishedAt", () => {
|
||||
it("returns the value of the first 'published_at' tag", () => {
|
||||
expect(article.publishedAt).toEqual(1726402055);
|
||||
|
||||
27
tests/nostr_test.ts
Normal file
27
tests/nostr_test.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
// import { describe, it } from "@std/testing/bdd";
|
||||
// import { stub } from "@std/testing/mock";
|
||||
// import { expect } from "@std/expect";
|
||||
// import { NostrEvent, NostrFilter } from "@nostrify/nostrify";
|
||||
// import * as nostr from "../nostr.ts";
|
||||
//
|
||||
// async function fetchWithTimeout(filters: NostrFilter[]) {
|
||||
// console.log("================")
|
||||
// const events = [];
|
||||
// const fixtures = [ "article-1.json", "article-deleted.json" ]
|
||||
// for (const filename of fixtures) {
|
||||
// const event = JSON.parse(Deno.readTextFileSync(`tests/fixtures/${filename}`));
|
||||
// events.push(event);
|
||||
// }
|
||||
// return Promise.resolve(events);
|
||||
// }
|
||||
//
|
||||
// describe("Nostr", () => {
|
||||
// describe("#fetchArticlesByAuthor", () => {
|
||||
// it("removes the anchor links for headlines", async () => {
|
||||
// stub(nostr, "fetchArticlesByAuthor");
|
||||
//
|
||||
// const articles = await nostr.fetchArticlesByAuthor("123456abcdef");
|
||||
// expect(articles.length).toEqual(2);
|
||||
// });
|
||||
// });
|
||||
// });
|
||||
Reference in New Issue
Block a user