<commit_before>require('babel-register');

const test                = require('tape');
const makeStatusActions   = require('../lib/builders/makeStatusActions').default;
const { defaultCallOpts } = require('../lib/middleware');

test.only('makeStatusActions', t => {
  t.plan(9);

  const plainActions = { 400: 'SOME_ACTION' };
  const plainDispatch = action => t.equal(
    action.type, 'SOME_ACTION', 'dispatches given action as type'
  );
  makeStatusActions(plainActions, defaultCallOpts, plainDispatch)
    .then(sa => sa[400]())
    .catch(t.fail);

  const fnDispatch = () => true;
  const fnRes = { code: 400 };
  const fnActions = {
    400: (dispatch, res) => {
      t.equal(dispatch, fnDispatch, 'called action w/ dispatch');
      t.equal(res, fnRes, 'called action w/ response');
    }
  };
  makeStatusActions(fnActions, defaultCallOpts, fnDispatch)
    .then(sa => sa[400](fnRes))<commit_msg>Remove test focus (oops)<commit_after>require('babel-register');

const test                = require('tape');
const makeStatusActions   = require('../lib/builders/makeStatusActions').default;
const { defaultCallOpts } = require('../lib/middleware');

test('makeStatusActions', t => {
  t.plan(9);

  const plainActions = { 400: 'SOME_ACTION' };
  const plainDispatch = action => t.equal(
    action.type, 'SOME_ACTION', 'dispatches given action as type'
  );
  makeStatusActions(plainActions, defaultCallOpts, plainDispatch)
    .then(sa => sa[400]())
    .catch(t.fail);

  const fnDispatch = () => true;
  const fnRes = { code: 400 };
  const fnActions = {
    400: (dispatch, res) => {
      t.equal(dispatch, fnDispatch, 'called action w/ dispatch');
      t.equal(res, fnRes, 'called action w/ response');
    }
  };
  makeStatusActions(fnActions, defaultCallOpts, fnDispatch)
    .then(sa => sa[400](fnRes))
{'fraction_non_alphanumeric': 0.15861690450054886, 'fraction_numerical': 0.01756311745334797, 'mean_word_length': 3.784776902887139, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '3929090', 'n_tokens_mistral': 603, 'n_tokens_neox': 575, 'n_words': 128}