jam-my-stack/test/webmention/send.test.js

25 lines
499 B
JavaScript
Raw Normal View History

2021-03-17 22:15:43 +01:00
describe("webmention send serve-my-jam tests", () => {
const got = require('got')
const { sendWebmentions } = require('./../../src/webmention/send')
let calledPut = ""
2021-03-17 22:15:43 +01:00
beforeEach(() => {
got.put = function(url) {
calledPut = url
2021-03-17 22:15:43 +01:00
}
});
test("sendWebmentions", async() => {
2022-04-25 09:26:26 +02:00
await sendWebmentions('brainbaking.com', {
token: 'lol',
endpoint: 'https://jam.brainbaking.com'
})
expect(calledPut).toBe("https://jam.brainbaking.com/webmention/brainbaking.com/lol")
2021-03-17 22:15:43 +01:00
})
})