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

Add initial set of tests #51

Merged
merged 1 commit into from
Mar 16, 2016
Merged

Conversation

kborchers
Copy link
Collaborator

Sets up Enzyme, Mocha, Chai tests run via Grunt. Also moves linting to a Grunt task.
Fixes #1

@rxaviers
Copy link
Member

Kris, great work on getting tests setup here! 🎉

About grunt, given our tasks are quite simple, I'm wondering if we could drop using grunt and make use of npm script tasks instead. They are simpler to maintain. Obviously, this could be tackled as a separate issue if you don't want to touch it for now.

require( "cldr-data/main/en/currencies" ),
require( "cldr-data/supplemental/currencyData" ),
require( "cldr-data/supplemental/likelySubtags" )
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume the specificity of CLDR content isn't subject to react-globalize tests goal, so I would simply replace these with:

Globalize.load(
  require( "cldr-data" ).entireSupplemental(),
  require( "cldr-data" ).entireMainFor( "en" )
);

Ideally, we could place this in a before step for all tests and don't need to write this in every files. :)

@kborchers
Copy link
Collaborator Author

I'm wondering if we could drop using grunt and make use of npm script tasks instead

I would be fine with that but maybe create an issue and do that separately since it would impact more than just tests

const wrapper = shallow(<FormatMessage locale="en" path="task" variables={{count: 1}} />);
expect(wrapper.text()).to.eql("You have one task remaining");
});
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need tests using default message (no path attribute).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wasn't meant to be a comprehensive test suite but instead a start and we can add as we go. That said, I will add that test as it will fail during development of the solution for #34 which will be helpful

@rxaviers
Copy link
Member

Are there any options that we list in our documentation (i.e., README.md) that are not being tested?

@rxaviers
Copy link
Member

Are there any options that we list in our documentation (i.e., README.md) that are not being tested?

Ah! One is elements attribute for FormatMessage.

@kborchers
Copy link
Collaborator Author

Are there any options that we list in our documentation (i.e., README.md) that are not being tested?

Definitely. Like I mentioned in a previous line comment, this was not meant to be a comprehensive set of tests on this first pass. My goal was to get the structure in place and some initial tests and folks can add tests as they have time.

"eslint": "^1.10.3",
"eslint-config-defaults": "^7.1.1",
"eslint-plugin-react": "^3.11.2",
"globalize": ">= 1.0.0 || 1.1.0-alpha - 1.1.x",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's stick with 1.1.x here in devDependencies.

@rxaviers
Copy link
Member

Great job so far!

@kborchers
Copy link
Collaborator Author

I believe I have addressed all comments except the following:

  • still need more tests but we can add as we go
  • did not pull from src as we need to figure out how to properly address the esperanto/AMD issues

Otherwise, should be good to go and squashed the commits as well

@rxaviers
Copy link
Member

@kborchers, it LGTM 👍.

@kborchers kborchers merged commit 259fb5d into globalizejs:master Mar 16, 2016
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.

3 participants