<commit_before>const Volumes = require('../Volumes');
const Batch = require('../../../../../../../src/js/structs/Batch');
const Transaction = require('../../../../../../../src/js/structs/Transaction');
const {ADD_ITEM, REMOVE_ITEM, SET} =
  require('../../../../../../../src/js/constants/TransactionTypes');

describe('Volumes', function () {
  describe('#JSONReducer', function () {
    it('should return an empty array if no volumes are set', function () {
      const batch = new Batch();

      expect(batch.reduce(Volumes.JSONReducer, [])).toEqual([]);
    });

    it('should return a local volume', function () {
      let batch = new Batch();<commit_msg>Fix volumes test by binding the right context<commit_after>const Volumes = require('../Volumes');
const Batch = require('../../../../../../../src/js/structs/Batch');
const Transaction = require('../../../../../../../src/js/structs/Transaction');
const {ADD_ITEM, REMOVE_ITEM, SET} =
  require('../../../../../../../src/js/constants/TransactionTypes');

describe('Volumes', function () {
  describe('#JSONReducer', function () {
    it('should return an empty array if no volumes are set', function () {
      const batch = new Batch();

      expect(batch.reduce(Volumes.JSONReducer.bind({}), [])).toEqual([]);
    });

    it('should return a local volume', function () {
      let batch = new Batch();
{'fraction_non_alphanumeric': 0.23956043956043957, 'fraction_numerical': 0.0, 'mean_word_length': 2.8263305322128853, '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': '7488787', 'n_tokens_mistral': 387, 'n_tokens_neox': 380, 'n_words': 96}