Add Thesisly research reader frontend and project design skills
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import { test } from "node:test";
|
||||
import assert from "node:assert/strict";
|
||||
import { readFileSync } from "node:fs";
|
||||
const snapshot = JSON.parse(readFileSync(new URL("../src/data/papers.json",import.meta.url),"utf8"));
|
||||
test("paper sample has unique source identities and retained abstracts",()=>{
|
||||
assert.equal(snapshot.papers.length,20);
|
||||
assert.equal(new Set(snapshot.papers.map(p=>p.id)).size,20);
|
||||
for(const p of snapshot.papers){assert.ok(p.title.length>0);assert.ok(p.abstract?.length>0);assert.ok(p.authors.length>0);assert.ok(p.sources.length>0);for(const s of p.sources){assert.equal(new URL(s.url).protocol,"https:");assert.ok(s.externalId);}}
|
||||
});
|
||||
test("sample does not invent popularity, code repositories or editorial conclusions",()=>{
|
||||
for(const p of snapshot.papers){for(const k of ["stars","downloads","citations","codeUrl","aiSummary","trendingRank"])assert.equal(k in p,false);}
|
||||
});
|
||||
Reference in New Issue
Block a user