These are chat archives for reflux/refluxjs

Jul 2015
Egor Gumenyuk
Jul 20 2015 16:40
Are components should listen stores only?
Iliyan Betovski
Jul 20 2015 21:43

Hello. I am trying TDD with Jest and Reflux.
Doesn't look like something too complicated but I am not able to trigger the Store's listener on the action.
Can somebody help me because I am in a dead end already.
Skip the "expect" assertions in the code, I don't see the console logs that I put there for debugging if the store's functions are invoked at all.
Here is the test:


describe('List', function() {
  var React;
  var Store;
  var Actions;
  var TestUtils;

  beforeEach(function() {
    Actions = require('../app/actions/ListActions.js');
    Store = require('../app/stores/ListStore.js');
  it('should add todo to the list', function() {
    // this is supposed to trigger the Store's listener but it doesn't
      text: "To do something"

And here is the Store:

var Reflux = require('reflux');
var ListActions = require('../actions/ListActions.js');

var ListStore = Reflux.createStore({
  listenables: ListActions, // tried with  [ListAction] but without any success

  onAddItem: function() {

// checked if there was a problem with the names of the functions.
  addItem: function() {


module.exports = ListStore;

Here is the entire test file:
Here is the store file:

Iliyan Betovski
Jul 20 2015 21:59
And here is the Actions file:
var Reflux = require('reflux');
var ListActions = Reflux.createActions([

module.exports = ListActions;