e2e test mastodon with real url
This commit is contained in:
parent
add5f883f5
commit
90773a2521
|
@ -0,0 +1,31 @@
|
|||
|
||||
const fs = require('fs');
|
||||
const fsp = require('fs').promises;
|
||||
const { rmdir } = require('./../utils')
|
||||
|
||||
jest.disableAutomock()
|
||||
jest.unmock('got')
|
||||
|
||||
const { parseMastoFeed } = require('../../src/mastodon/feed-parser')
|
||||
const dumpdir = `${__dirname}/dump`
|
||||
|
||||
describe("mastodon feed parser end to end scenario test", () => {
|
||||
|
||||
beforeEach(() => {
|
||||
if(fs.existsSync(dumpdir)) {
|
||||
rmdir(dumpdir)
|
||||
}
|
||||
fs.mkdirSync(dumpdir)
|
||||
});
|
||||
|
||||
test("parse creates separate notes in each month subdir", async () => {
|
||||
await parseMastoFeed({
|
||||
url: "https://chat.brainbaking.com/users/wouter/feed",
|
||||
notesdir: dumpdir
|
||||
})
|
||||
|
||||
let dir = await fsp.readdir(`${dumpdir}/2021/03`, { withFileTypes: true })
|
||||
expect(dir.length).not.toBe(0)
|
||||
})
|
||||
|
||||
})
|
Loading…
Reference in New Issue