Skip to content

Node.js based forum software built for the modern web

test: use protocol of test runner

Julian Lam0481549734b5
diff --git a/test/posts.js b/test/posts.js
index 4fce2f2ff5..2ba85734d4 100644
--- a/test/posts.js
+++ b/test/posts.js
@@ -765,7 +765,7 @@ describe('Post\'s', () => {
const nconf = require('nconf');
const content = '<a href="/users">test</a> <a href="//youtube.com">youtube</a>';
const parsedContent = posts.relativeToAbsolute(content, posts.urlRegex);
- assert.equal(parsedContent, `<a href="${nconf.get('base_url')}/users">test</a> <a href="https://youtube.com/">youtube</a>`);
+ assert.equal(parsedContent, `<a href="${nconf.get('base_url')}/users">test</a> <a href="${nconf.get('url_parsed').protocol}//youtube.com/">youtube</a>`);
done();
});
@@ -774,7 +774,7 @@ describe('Post\'s', () => {
const content = '<a href="/users">test</a> <a href="//youtube.com">youtube</a> some test <img src="/path/to/img"/>';
let parsedContent = posts.relativeToAbsolute(content, posts.urlRegex);
parsedContent = posts.relativeToAbsolute(parsedContent, posts.imgRegex);
- assert.equal(parsedContent, `<a href="${nconf.get('base_url')}/users">test</a> <a href="https://youtube.com/">youtube</a> some test <img src="${nconf.get('base_url')}/path/to/img"/>`);
+ assert.equal(parsedContent, `<a href="${nconf.get('base_url')}/users">test</a> <a href="${nconf.get('url_parsed').protocol}//youtube.com/">youtube</a> some test <img src="${nconf.get('base_url')}/path/to/img"/>`);
done();
});
});