-
Notifications
You must be signed in to change notification settings - Fork 10.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NEW] Start running unit tests #6605
Conversation
96269d2
to
ca83b60
Compare
….Chat into unit-test-mentions
ca83b60
to
328920e
Compare
import assert from 'assert'; | ||
|
||
import Mentions from '../Mentions'; | ||
const mention = new Mentions({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While it might make sense to dry up the test and have a single instance of Mentions
for all the tests, this poses a risk as the state of the instance can be mutated by tests.
I would advise to move this to a before
block so that a new instance is created for each test. If more speed is needed we can run tests in parallel :)
import MentionsServer from '../MentionsServer'; | ||
|
||
|
||
const mention = new MentionsServer({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a beforeEach
here too. See the client unit tests comment
@samhatoum thanks for the advice! I would like to know what you think about split the code in client/server/functions and use no mocks just 'source functions'. Another thing, how can I ignore the |
…nto unit-test-mentions
…nto unit-test-mentions
6876f6d
to
a661759
Compare
d0c6c92
to
e91395a
Compare
bdd1b3b
to
3702938
Compare
…nto unit-test-mentions
f2f6619
to
77c766e
Compare
…nto unit-test-mentions
…nto unit-test-mentions
…cket.Chat into unit-test-mentions
….Chat into unit-test-mentions
…nto unit-test-mentions
@rodrigok