<commit_before>/*!
 * Module dependencies.
 */

var events = require('events'),
    fs = require('fs'),
    archiver = require('archiver'),
    path = require('path'),
    phonegap = require('../../lib'),
    request = require('supertest'),
    shell = require('shelljs'),
    zip = require('../../lib/middleware/zip'),
    url = '/__api__/appzip';

/*!
 * Specification: Middleware for /zip route
 */

describe('zip middleware', function() {
    beforeEach(function() {
        spyOn(process, 'cwd').andReturn(path.resolve(__dirname, '../fixture/app-without-cordova'));
    });

    describe('GET /__api__/appzip', function() {
        it('should generate a zip', function(done) {
            createSpy = jasmine.createSpy('create');
            spyOn(archiver, 'create').andCallFake(createSpy);

            request(phonegap())
            .get('/__api__/appzip')
            .end(function(e, res) {
                expect(createSpy).toHaveBeenCalled()
                done();
            });
        });
    
        describe('successfully generated zip', function() {
            it('should have a 200 response code', function(done) {
                request(phonegap())
                .get('/__api__/appzip')
                .end(function(e, res) {
                    expect(res.statusCode).toEqual(200);
                    done();
                });
            });<commit_msg>[#113] Fix hanging test runner.<commit_after>/*!
 * Module dependencies.
 */

var events = require('events'),
    fs = require('fs'),
    archiver = require('archiver'),
    gaze = require('gaze'),
    path = require('path'),
    phonegap = require('../../lib'),
    request = require('supertest'),
    shell = require('shelljs'),
    zip = require('../../lib/middleware/zip'),
    url = '/__api__/appzip';

/*!
 * Specification: Middleware for /zip route
 */

describe('zip middleware', function() {
    beforeEach(function() {
        spyOn(gaze, 'Gaze').andReturn({ on: function() {} });
        spyOn(process, 'cwd').andReturn(path.resolve(__dirname, '../fixture/app-without-cordova'));
    });

    describe('GET /__api__/appzip', function() {
        it('should generate a zip', function(done) {
            createSpy = jasmine.createSpy('create');
            spyOn(archiver, 'create').andCallFake(createSpy);

            request(phonegap())
            .get('/__api__/appzip')
            .end(function(e, res) {
                expect(createSpy).toHaveBeenCalled();
                done();
            });
        });
    
        describe('successfully generated zip', function() {
            it('should have a 200 response code', function(done) {
                request(phonegap())
                .get('/__api__/appzip')
                .end(function(e, res) {
                    expect(res.statusCode).toEqual(200);
                    done();
                });
            });
{'fraction_non_alphanumeric': 0.1696149843912591, 'fraction_numerical': 0.005202913631633715, 'mean_word_length': 2.0230607966457024, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '7219940', 'n_tokens_mistral': 832, 'n_tokens_neox': 798, 'n_words': 148}