<commit_before>describe('Escaped formdata', function() {
    var _ = require('lodash'),
        testrun;

    before(function(done) {
        this.run({
            environment: {
                values: [
                    {key: 'msg', value: 'hello\\kworld', type: 'text', name: 'msg', enabled: true},
                    {key: 'msg1', value: 'hello', type: 'text', name: 'msg', enabled: true}
                ]
            },
            collection: {
                item: [{
                    event: [{
                        listen: 'test',
                        script: {
                            exec: [
                                'var data=JSON.parse(responseBody);',
                                'tests[\'Form Key Replaced\'] = data.form.hasOwnProperty(\'hello\');',
                                'tests[\'Form val replaced from env\'] = data.form.hello === \'hello\\\\kworld\';'
                            ]
                        }
                    }],
                    request: {
                        url: 'https://postman-echo.com/post?a={{msg}}',
                        method: 'POST',
                        body: {
                            mode: 'urlencoded',
                            urlencoded: [{key: '{{msg1}}', value: '{{msg}}', type: 'text', enabled: true},
                                {key: 'incollection', value: 'hello\\world', type: 'text', enabled: true}]
                        }
                    }
                }]
            }
        }, function(err, results) {
            testrun = results;
            done(err);
        });
    });

    it('must have run the test script successfully', function() {
        expect(testrun).be.ok();
        expect(testrun.test.calledOnce).be.ok();

        expect(testrun.test.getCall(0).args[0]).to.be(null);
        expect(_.get(testrun.test.getCall(0).args[2], '0.result.globals.tests')).to.eql({
            'Form Key Replaced': true,
            'Form val replaced from env': true
        });
    });

    it('must have completed the run', function() {
        expect(testrun).be.ok();
        expect(testrun.done.calledOnce).be.ok();
        expect(testrun.done.getCall(0).args[0]).to.be(null);
        expect(testrun.start.calledOnce).be.ok();
    });
});<commit_msg>updated the escaped formdata test<commit_after>describe('escaped formdata', function() {
    var _ = require('lodash'),
        testrun;

    before(function(done) {
        this.run({
            environment: {
                values: [
                    {key: 'msg', value: 'hello\\kworld', type: 'text', name: 'msg', enabled: true},
                    {key: 'msg1', value: 'hello', type: 'text', name: 'msg', enabled: true}
                ]
            },
            collection: {
                item: [{
                    request: {
                        url: 'https://postman-echo.com/post?a={{msg}}',
                        method: 'POST',
                        body: {
                            mode: 'urlencoded',
                            urlencoded: [{key: '{{msg1}}', value: '{{msg}}', type: 'text', enabled: true},
                                {key: 'incollection', value: 'hello\\world', type: 'text', enabled: true}]
                        }
                    }
                }]
            }
        }, function(err, results) {
            testrun = results;
            done(err);
        });
    });

    it('must have sent the request successfully', function() {
        expect(testrun).be.ok();
        expect(testrun.request.calledOnce).be.ok();

        expect(testrun.request.getCall(0).args[0]).to.be(null);
    });

    it('must escaped the formdata correctly', function() {
        var response = testrun.request.getCall(0).args[2],
            body = JSON.parse(response.body);

        expect(body.form).to.have.property('hello', 'hello\\kworld');
    });

    it('must have completed the run', function() {
        expect(testrun).be.ok();
        expect(testrun.done.calledOnce).be.ok();
        expect(testrun.done.getCall(0).args[0]).to.be(null);
        expect(testrun.start.calledOnce).be.ok();
    });
});
{'fraction_non_alphanumeric': 0.15997113302862642, 'fraction_numerical': 0.004089487611258119, 'mean_word_length': 1.3518099547511313, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '3008038', 'n_tokens_mistral': 1156, 'n_tokens_neox': 1105, 'n_words': 212}