X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Factivitypub%2Fhelpers.ts;h=60d95b823f2f916257b82f2d38676b2340a0da67;hb=9129b7694d577322327ee79e9b9aa64deee92765;hp=0d1f154fe5bc503b231271bd5cea1bfa6888537d;hpb=00aab0666c6f772548c160fdfa871a8843b88f37;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/activitypub/helpers.ts b/server/tests/api/activitypub/helpers.ts index 0d1f154fe..60d95b823 100644 --- a/server/tests/api/activitypub/helpers.ts +++ b/server/tests/api/activitypub/helpers.ts @@ -1,4 +1,4 @@ -/* tslint:disable:no-unused-expression */ +/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import 'mocha' import { expect } from 'chai' @@ -76,7 +76,6 @@ describe('Test activity pub helpers', function () { const mastodonObject = cloneDeep(require('./json/mastodon/bad-http-signature.json')) req.body = mastodonObject.body req.headers = mastodonObject.headers - req.headers.signature = 'Signature ' + req.headers.signature const parsed = parseHTTPSignature(req, 3600 * 1000 * 365 * 10) const publicKey = require('./json/mastodon/public-key.json').publicKey @@ -95,7 +94,6 @@ describe('Test activity pub helpers', function () { const mastodonObject = cloneDeep(require('./json/mastodon/http-signature.json')) req.body = mastodonObject.body req.headers = mastodonObject.headers - req.headers.signature = 'Signature ' + req.headers.signature const parsed = parseHTTPSignature(req, 3600 * 1000 * 365 * 10) const publicKey = require('./json/mastodon/bad-public-key.json').publicKey @@ -114,7 +112,6 @@ describe('Test activity pub helpers', function () { const mastodonObject = cloneDeep(require('./json/mastodon/http-signature.json')) req.body = mastodonObject.body req.headers = mastodonObject.headers - req.headers.signature = 'Signature ' + req.headers.signature let errored = false try { @@ -126,7 +123,7 @@ describe('Test activity pub helpers', function () { expect(errored).to.be.true }) - it('Should fail without scheme', async function () { + it('Should with a scheme', async function () { const req = buildRequestStub() req.method = 'POST' req.url = '/accounts/ronan/inbox' @@ -134,6 +131,7 @@ describe('Test activity pub helpers', function () { const mastodonObject = cloneDeep(require('./json/mastodon/http-signature.json')) req.body = mastodonObject.body req.headers = mastodonObject.headers + req.headers = 'Signature ' + mastodonObject.headers let errored = false try { @@ -153,7 +151,6 @@ describe('Test activity pub helpers', function () { const mastodonObject = cloneDeep(require('./json/mastodon/http-signature.json')) req.body = mastodonObject.body req.headers = mastodonObject.headers - req.headers.signature = 'Signature ' + req.headers.signature const parsed = parseHTTPSignature(req, 3600 * 1000 * 365 * 10) const publicKey = require('./json/mastodon/public-key.json').publicKey