flux icon indicating copy to clipboard operation
flux copied to clipboard

Unit tests for dispatcher?

Open sterpe opened this issue 12 years ago • 5 comments

No test folder in the repo, but assume (some) exists somewhere.

sterpe avatar Oct 15 '14 21:10 sterpe

I can port over Facebook's internal tests, I think. Let's keep this issue open until I get that done.

fisherwebdev avatar Oct 25 '14 21:10 fisherwebdev

@fisherwebdev The tests expect the Dispatcher with waitFor taking 2nd argument: https://github.com/facebook/flux/commit/83a9505d9814f034bc19c451e011bca0b738b273#diff-e0947f38df5ab3cb5b2137999fb1a23cR141

The Dispatcher in the repo does not match this signature, it takes a single argument: https://github.com/facebook/flux/blob/master/src/Dispatcher.js#L154

sompylasar avatar Nov 08 '14 22:11 sompylasar

I'm not sure what those tests are trying to do. I copied these over from our internal tests, but these don't make sense. I also can't find any history in our internal code of some legacy version of the dispatcher having these second arguments. I'll ask around at FB about this, but for now I'm going to pull out those tests.

fisherwebdev avatar Nov 09 '14 20:11 fisherwebdev

Did not pull out the tests, but rather simply fixed them to take the correct arguments. These are the tests that make sure the dispatcher throws an error if you create a circular dependency -- very important.

fisherwebdev avatar Nov 09 '14 20:11 fisherwebdev

@fisherwebdev Thanks! didn't see this.

sterpe avatar Jan 30 '15 18:01 sterpe