colocate tests in flat structure#10655
Conversation
|
Keeping the |
There was a problem hiding this comment.
I straight-up murdered this test cause I couldn't figure out wtf it was trying to do or why it had a mock store.
There was a problem hiding this comment.
and there was already a test file with test cases for this component in the directory in question
Builds ready [d19d046]
Page Load Metrics (653 ± 25 ms)
|
4dd7dcb to
080898e
Compare
Builds ready [080898e]
Page Load Metrics (623 ± 35 ms)
|
080898e to
3d22d39
Compare
Builds ready [3d22d39]
Page Load Metrics (734 ± 78 ms)
|
| @@ -0,0 +1,82 @@ | |||
| import assert from 'assert'; | |||
| import freeze from 'deep-freeze-strict'; | |||
| import reducers from '../ducks'; | |||
There was a problem hiding this comment.
This seems to be testing the reducers more than the action constants 🤔
This is definitely a huge improvement from how these were organized before though!
| "test:unit:global": "mocha --exit --require test/env.js --require test/setup.js --recursive test/unit-global/*.test.js", | ||
| "test:unit:lax": "mocha --exit --require test/env.js --require test/setup.js --recursive \"test/unit/{,**/!(permissions)}/*.test.js\" \"ui/app/**/*.test.js\" \"shared/**/*.test.js\"", | ||
| "test:unit:strict": "mocha --exit --require test/env.js --require test/setup.js --recursive \"test/unit/**/permissions/*.test.js\"", | ||
| "test:unit:lax": "mocha --exit --require test/env.js --require test/setup.js --recursive './{ui,app,shared}/{,**/!(permissions)}/*.test.js'", |
There was a problem hiding this comment.
This could exclude other directories named "permissions" as well. I don't think we have any right now, but that's an unfortunate foot-fun to leave laying around.
I'll try to think of an alternative syntax, and we can fix it in a follow-up PR.
Moves test files to be colocated with the code under test, without nesting in
testfolders.A: Put it in
test/helpers/,test/mocks/ortest/stubs/-- whichever is most relevant