<commit_before>'use strict';

var should = require('should');
var app = require('../../app');
var request = require('supertest');

describe('GET /api/v1/scripts', function() {

  it('should create initial scripts and respond with JSON array', function(done) {
    request(app)
      .get('/api/v1/scripts')
      .expect(201)
      .expect('Content-Type', /json/)
      .end(function(err, res) {
        if (err) return done(err);
        res.body.should.be.instanceof(Array);
        done();
      });
  });
});<commit_msg>fixing script test to pass every time<commit_after>'use strict';

var should = require('should');
var app = require('../../app');
var request = require('supertest');
var Script = require('./script.model');

describe('GET /api/v1/scripts', function() {

  it('should create initial scripts and respond with JSON array when there are no scripts in the db', function(done) {
    Script.remove({}, function (err) {
      request(app)
        .get('/api/v1/scripts')
        .expect(201)
        .expect('Content-Type', /json/)
        .end(function(err, res) {
          if (err) return done(err);
          res.body.should.be.instanceof(Array);
          done();
        });
    });
  });
});
{'fraction_non_alphanumeric': 0.179719703215169, 'fraction_numerical': 0.008244023083264633, 'mean_word_length': 2.79375, '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': '2209365', 'n_tokens_mistral': 369, 'n_tokens_neox': 360, 'n_words': 94}