Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated to latest babel modules #5

Closed
wants to merge 1 commit into from
Closed

Updated to latest babel modules #5

wants to merge 1 commit into from

Conversation

mummybot
Copy link

@mummybot mummybot commented Apr 6, 2016

When working through the tutorial the latest version of babel has nerfed the "default" module export behaviour.

It requires adding the transform export extensions plugin, otherwise the following will not work:

// core.js
export function setEntries(state, entries) {
  return state.set('entries', entries);
}

//core_spec.js
import {List as list, Map as map} from 'immutable';
import {expect} from 'chai';
import {setEntries} from '../src/core';

describe('application logic', () => {
  describe('setEntries', () => {
    it('adds the entries to the state', () => {
      const entries = list.of('Trainspotting', '28 Days Later');
      const state = map();
      const nextState = setEntries(state, entries); // setEntries is undefined unless the transform export extensions plugin is enabled

      expect(nextState).to.equal(map({
        entries: list.of('Trainspotting', '28 Days Later')
      }));
    });
  });
});

@mummybot mummybot closed this Jun 8, 2021
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant