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
[HTML5 Client] Setup for React Tests #4549
[HTML5 Client] Setup for React Tests #4549
Conversation
…ong with Selenium specs).
It also fixes the favicon.ico warning which you could see in the FF web console. |
@@ -62,6 +65,7 @@ | |||
"postcss-modules-scope": "1.1.0", | |||
"postcss-modules-values": "1.3.0", | |||
"postcss-nested": "2.0.2", | |||
"selenium-webdriver": "3.0.0-beta-2", |
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.
beta packages?
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.
All later versions work only with Node 6.x+, but Meteor is still using 4.x.
We can try to update it once Meteor updates its Node version (which is supposed to happen in Meteor 16).
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.
Meteor 16 brings in Node 8.x
@@ -0,0 +1,5 @@ | |||
describe('Server tests', () => { | |||
it('fail', () => { | |||
|
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.
Why is this empty?
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.
Nice work.
Could you add real tests cases? I didn't figure out what type of tests are being added nor how should I write them for ReactComponents nor Server-side (collections, meteor stuff).
A little worried about the selenium-webdriver
being on a beta version, but since tests are only for dev (no CI right now) should be fine.
Another question, are we having the tests specs on a different folder? Isn't easier to have it together with file being tested with a .test.{js,jsx}
extension?
Re: having test specs on a different folder.
|
@oswaldoacauan |
So the best scenario should be:
👍 |
Can we initialize the collections inside their respective file?
import { Meteor } from 'meteor/meteor';
const Users = new Mongo.Collection('users');
if (Meteor.isServer) {
// types of queries for the users:
// 1. meetingId
// 2. meetingId, userId
Users._ensureIndex({ meetingId: 1, userId: 1 });
}
if (Meteor.isTest) {
// fixture data
}
export default Users; |
This PR introduces the initial test setup for Meteor React tests. Some sample test specs are added, as well as various testing packages and NPM script command.
Meteor tests have to be outside of
tests
folder at the time of execution. But if we store them permanently there, they are included in the build. So the test script does the following:/tests/meteor
to/imports/meteor-tests