{"size": 1035, "ext": "js", "max_stars_repo_path": "src/index.test.js", "max_stars_repo_name": "rfloriano/remote-http-middleware", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/index.test.js", "max_issues_repo_name": "rfloriano/remote-http-middleware", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/index.test.js", "max_forks_repo_name": "rfloriano/remote-http-middleware", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 32.34375, "max_line_length": 69, "alphanum_fraction": 0.6}
const HtmlWebpackPlugin = require('html-webpack-plugin');
const createRemoteHttpMiddleware = require('./index');
const { RemoteHttpMiddleware } = require('./remote-http-middleware');
const { ReferenceError } = require('./errors');
const getRawBody = require('raw-body');
const http = require('http');

jest.mock('raw-body');

describe('test', () => {
    beforeEach(() => {
        this.htmlWebpackPlugin = new HtmlWebpackPlugin();
        this.config = {
            plugins: [
                this.htmlWebpackPlugin
            ],
            HtmlWebpackPlugin: HtmlWebpackPlugin
        };
        this.instance = new RemoteHttpMiddleware(this.config);
    });

    describe('createRemoteHttpMiddleware function', () => {
        it('should bind do method', () => {
            const spy = spyOn(RemoteHttpMiddleware.prototype, 'do');
            const fn = createRemoteHttpMiddleware(this.config);
            expect(spy).not.toHaveBeenCalled();
            fn();
            expect(spy).toHaveBeenCalled();
        })
    });
});
