{"size": 1148, "ext": "js", "max_stars_repo_path": "spec/jasmine-allow-from-url.tests.js", "max_stars_repo_name": "pmdevita/html-webpack-inline-svg-plugin", "max_stars_repo_stars_event_min_datetime": "2017-05-02T14:14:32.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-22T13:08:08.000Z", "max_issues_repo_path": "spec/jasmine-allow-from-url.tests.js", "max_issues_repo_name": "pmdevita/html-webpack-inline-svg-plugin", "max_issues_repo_issues_event_min_datetime": "2017-06-06T12:49:47.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-12T23:10:34.000Z", "max_forks_repo_path": "spec/jasmine-allow-from-url.tests.js", "max_forks_repo_name": "pmdevita/html-webpack-inline-svg-plugin", "max_forks_repo_forks_event_min_datetime": "2017-08-11T15:26:17.000Z", "max_forks_repo_forks_event_max_datetime": "2021-05-24T20:25:08.000Z"}
{"max_stars_count": 66, "max_issues_count": 44, "max_forks_count": 27, "avg_line_length": 26.0909090909, "max_line_length": 128, "alphanum_fraction": 0.5409407666}
var path = require('path')
var fs = require('fs')
var cheerio = require('cheerio')
var webpackConfig = require('./webpack.base.config')

module.exports = [

    {
        label: 'should inline all SVG images (even the ones being an URL) and exclude images with the inline-exclude attribute',
        func: function (done) {

            var htmlFile = path.resolve(webpackConfig.outputDir, 'index-allow-from-url.html')

            return fs.readFile(htmlFile, 'utf8', function (err, data) {
                expect(err).toBeFalsy()

                var $ = cheerio.load(data)

                expect($('img#find-and-replace-me').length).toBe(1)

                expect($('svg#find-and-replace-me').length).toBe(0)

                expect($('img#replace-me').length).toBe(0)

                expect($('svg#replace-me').length).toBe(1)

                expect($('img#replace-me-too').length).toBe(0)

                expect($('svg#replace-me-too').length).toBe(1)

                expect($('img#not-an-svg').length).toBe(1)

                expect($('div#do-not-decode').length).toBe(1)

                done()

            })

        },

    },

]
