Created
April 1, 2015 21:24
-
-
Save acdlite/dfbac9ed62474e1be605 to your computer and use it in GitHub Desktop.
Create Flummox actions from plain JavaScript objects
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const flux = new Flux(); | |
flux.createActions('foobar', { | |
foo() { | |
return 'bar'; | |
}, | |
bar() { | |
return 'baz'; | |
} | |
}); | |
expect(flux.getActions('foobar')).to.be.an.instanceof(Actions); | |
expect(flux.getActions('foobar').foo()).to.equal('bar'); | |
expect(flux.getActions('foobar').bar()).to.equal('baz'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Copied from Flummox's test suite: https://github.com/acdlite/flummox/blob/master/src/__tests__/Flux-test.js#L134-L150