<commit_before>import expect from 'expect';
// import {createStore, combineReducers} from '../src/index'
// import {addTodo, dispatchInMiddle, throwError, unknownAction} from './helpers/actionCreators'
// import * as reducers from './helpers/reducers'

// import {createResource} from '../src';
import {createTypes, getActionType} from '../src/types';
import {defaultActions} from '../src/defaults';
import {values} from 'lodash';
try { require('debug-utils'); } catch (err) {}; // eslint-disable-line

describe('createTypes', () => {
  it('should throw if name is undefined', () => {
    expect(() => {
      const types = createTypes();
      expect(types).toBeA('object');
    }).toThrow();
  });
  it('should properly return an object with properly named keys', () => {
    const name = 'user';
    const types = createTypes({name});
    const expectedKeys = Object.keys(defaultActions).map(actionKey => actionKey.toUpperCase());
    expect(Object.keys(types)).toEqual(expectedKeys);
    const expectedValuesFn = action => expect(action).toBeA('string');
    values(types).forEach(expectedValuesFn);
    const expectedValues = Object.keys(defaultActions).map(actionKey => getActionType({name, actionKey}));
    expect(values(types)).toEqual(expectedValues);
  });
});<commit_msg>test(types): update types test<commit_after>import expect from 'expect';
// import {createStore, combineReducers} from '../src/index'
// import {addTodo, dispatchInMiddle, throwError, unknownAction} from './helpers/actionCreators'
// import * as reducers from './helpers/reducers'

// import {createResource} from '../src';
import {createTypes, getActionKey, getActionType} from '../src/types';
import {defaultActions} from '../src/defaults';
import {values} from 'lodash';
try { require('debug-utils'); } catch (err) {}; // eslint-disable-line

describe('createTypes', () => {
  it('should throw if name is undefined', () => {
    expect(() => {
      const types = createTypes();
      expect(types).toBeA('object');
    }).toThrow();
  });
  it('should properly return an object with properly named keys', () => {
    const name = 'user';
    const types = createTypes({name});
    const expectedKeys = Object.keys(defaultActions).map(actionKey => getActionKey({actionKey}));
    expect(Object.keys(types)).toEqual(expectedKeys);
    const expectedValuesFn = action => expect(action).toBeA('string');
    values(types).forEach(expectedValuesFn);
    const expectedValues = Object.keys(defaultActions).map(actionKey => getActionType({name, actionKey}));
    expect(values(types)).toEqual(expectedValues);
  });
});
{'fraction_non_alphanumeric': 0.17121969988457098, 'fraction_numerical': 0.0, 'mean_word_length': 4.701754385964913, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, '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': '5857226', 'n_tokens_mistral': 726, 'n_tokens_neox': 725, 'n_words': 178}