You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
before() is handy to use in situations where there is setup and rendering that needs to occur but then you have several separate it()/expect() calls that verify the same data. Rather than using a beforeEach() which performs this setup each time a before() may be a better choice so the setup only has to occur once.
Yes, these two methods, and others, are listed in the Mocha user guides but before() is not often used in our codebases so the pattern is not one developers are easily made aware of without being familiar with Mocha's abilities (which, yes, in a perfect world, they would be)
The text was updated successfully, but these errors were encountered:
Per comments from @job13er in a Slack conversation:
also, you need to be aware it won't work in integration tests
the setupComponentTest stuff is done in beforeEach (edited)
and so, if you use a top-level before in an integration test, the application/ember stuff isn't ready yet
you may be able to use a before in a nested describe in an integration test, but I can't confirm that
before()
is handy to use in situations where there is setup and rendering that needs to occur but then you have several separateit()/expect()
calls that verify the same data. Rather than using abeforeEach()
which performs this setup each time abefore()
may be a better choice so the setup only has to occur once.Yes, these two methods, and others, are listed in the Mocha user guides but
before()
is not often used in our codebases so the pattern is not one developers are easily made aware of without being familiar with Mocha's abilities (which, yes, in a perfect world, they would be)The text was updated successfully, but these errors were encountered: