<commit_before>/*global describe, before, it */
import assert from 'assert'
import proxifyImageUrl from 'app/utils/ProxifyUrl'

describe('ProxifyUrl', () => {
    before(function (){
        global.$STM_Config = {img_proxy_prefix: 'https://steemitimages.com/'};
    });

    it('naked URL', () => {
        testCase('https://example.com/img.png', '100x200', 'https://steemitimages.com/100x200/https://example.com/img.png')
        testCase('https://example.com/img.png', '0x0', 'https://steemitimages.com/0x0/https://example.com/img.png')
        testCase('https://example.com/img.png', false, 'https://example.com/img.png')
    })
    it('naked steemit proxy URL', () => {
        testCase('https://steemitimages.com/DQmaJe2Tt5kmVUaFhse1KTEr4N1g9piMgD3YjPEQhkZi3HR/30day-positivity-challenge.jpg', '256x512', 'https://steemitimages.com/256x512/https://steemitimages.com/DQmaJe2Tt5kmVUaFhse1KTEr4N1g9piMgD3YjPEQhkZi3HR/30day-positivity-challenge.jpg')
        testCase('https://steemitimages.com/DQmaJe2Tt5kmVUaFhse1KTEr4N1g9piMgD3YjPEQhkZi3HR/30day-positivity-challenge.jpg', false, 'https://steemitimages.com/DQmaJe2Tt5kmVUaFhse1KTEr4N1g9piMgD3YjPEQhkZi3HR/30day-positivity-challenge.jpg')<commit_msg>code climate complaint<commit_after>/*global describe, before, it */
import assert from 'assert'
import proxifyImageUrl from './ProxifyUrl'

describe('ProxifyUrl', () => {
    before(function (){
        global.$STM_Config = {img_proxy_prefix: 'https://steemitimages.com/'};
    });

    it('naked URL', () => {
        testCase('https://example.com/img.png', '100x200', 'https://steemitimages.com/100x200/https://example.com/img.png')
        testCase('https://example.com/img.png', '0x0', 'https://steemitimages.com/0x0/https://example.com/img.png')
        testCase('https://example.com/img.png', false, 'https://example.com/img.png')
    })
    it('naked steemit proxy URL', () => {
        testCase('https://steemitimages.com/DQmaJe2Tt5kmVUaFhse1KTEr4N1g9piMgD3YjPEQhkZi3HR/30day-positivity-challenge.jpg', '256x512', 'https://steemitimages.com/256x512/https://steemitimages.com/DQmaJe2Tt5kmVUaFhse1KTEr4N1g9piMgD3YjPEQhkZi3HR/30day-positivity-challenge.jpg')
        testCase('https://steemitimages.com/DQmaJe2Tt5kmVUaFhse1KTEr4N1g9piMgD3YjPEQhkZi3HR/30day-positivity-challenge.jpg', false, 'https://steemitimages.com/DQmaJe2Tt5kmVUaFhse1KTEr4N1g9piMgD3YjPEQhkZi3HR/30day-positivity-challenge.jpg')
{'fraction_non_alphanumeric': 0.16701287910261736, 'fraction_numerical': 0.05650186954715413, 'mean_word_length': 4.7745803357314145, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 28, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '342478', 'n_tokens_mistral': 1045, 'n_tokens_neox': 958, 'n_words': 77}