Skip to content
This repository has been archived by the owner on Sep 18, 2020. It is now read-only.

Tests shouldn't use arrow function definitions according to #62

Closed
Shelagh-Lewins opened this issue Feb 15, 2018 · 2 comments
Closed

Tests shouldn't use arrow function definitions according to #62

Shelagh-Lewins opened this issue Feb 15, 2018 · 2 comments

Comments

@Shelagh-Lewins
Copy link

The example tests in the React tutorial simple todos and the todos project example use arrow function in all test definitions, like this:

if (Meteor.isServer) {
  describe('Tasks', () => {
    describe('methods', () => {
      it('can delete owned task', () => {
      });
    });
  });
}

However the Meteor guide says:

"Note that arrow function use with Mocha is discouraged."

https://guide.meteor.com/testing.html#test-files
http://mochajs.org/#arrow-functions

and shows an example like this:

describe('my module', function () {
  it('does something that should be tested', function () {
    // This code will be executed by the test driver when the app is started
    // in the correct mode
  })
})

Should the tutorial and examples avoid arrow functions as per the guide? Or have I misunderstood something?

@Shelagh-Lewins
Copy link
Author

Note this issue was discussed in 2016:

meteor/guide#318
meteor/guide#323

@filipenevola
Copy link
Collaborator

Hey @Shelagh-Lewins , thank you for your feedback.

I have incorporated your feedback here in this new repo, the new home of react tutorial.

https://github.com/meteor/react-tutorial/ (https://react-tutorial.meteor.com)

It's PR friendly so if you want to make more changes, go ahead there!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants