Skip to content
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

Merged
merged 20 commits into from
May 17, 2017
Merged

Conversation

ggazzo
Copy link
Member

@ggazzo ggazzo commented Apr 5, 2017

@ggazzo ggazzo force-pushed the unit-test-mentions branch from 96269d2 to ca83b60 Compare April 10, 2017 16:06
@ggazzo ggazzo force-pushed the unit-test-mentions branch from ca83b60 to 328920e Compare April 10, 2017 16:20
@engelgabriel engelgabriel modified the milestone: 0.56.0 Apr 18, 2017
import assert from 'assert';

import Mentions from '../Mentions';
const mention = new Mentions({

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({

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

@ggazzo
Copy link
Member Author

ggazzo commented Apr 26, 2017

@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 .babelrc when the meteor is building? I would like to put it in the root folder, but some warnings and errors appears.

@engelgabriel engelgabriel modified the milestones: 0.56.0, 0.57.0 May 9, 2017
@ggazzo ggazzo force-pushed the unit-test-mentions branch 4 times, most recently from 6876f6d to a661759 Compare May 12, 2017 18:30
@ggazzo ggazzo force-pushed the unit-test-mentions branch 2 times, most recently from d0c6c92 to e91395a Compare May 12, 2017 20:46
@ggazzo ggazzo force-pushed the unit-test-mentions branch 3 times, most recently from bdd1b3b to 3702938 Compare May 12, 2017 22:27
@ggazzo ggazzo force-pushed the unit-test-mentions branch from f2f6619 to 77c766e Compare May 16, 2017 17:24
@rodrigok rodrigok changed the title propose of unit test [NEW] Start running unit tests May 17, 2017
@rodrigok rodrigok merged commit 4f5b96e into RocketChat:develop May 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants