-
Notifications
You must be signed in to change notification settings - Fork 162
Fix: CI tests failing #136
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
Fix: CI tests failing #136
Conversation
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.
Thanks, just create the config object
src/components/contact/Contact.js
Outdated
@@ -6,14 +6,18 @@ import styles from './assets/contact.scss'; | |||
import peopleSearch from './assets/people-search.svg'; | |||
import SocialMedia from './SocialMedia'; | |||
|
|||
export const EMAIL = '[email protected]'; |
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.
Let's create a configuration file, where we get the value from the environment or assign a default value if empty: src/config/Constants.js
export default {
contact: {
EMAIL: process.env.EMAIL || '[email protected]',
SLACK_URL: process.env.SLACK_URL || '......',
},
social: {
FB_URL: process.env.FACEBOOK_URL || 'https://www.facebook.com/codingcoachio/',
INSTA_URL: process.env.INSTA_URL || 'https://www.instagram.com/',
TWITTER_URL: process.env.TWITTER_URL || 'https://twitter.com/codingcoach_io',
},
};
Then we will use the config object with the values from the env or the default.
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.
Hmm.. Good one. I was thinking of creating a constant file but never thought of mixing the env in the constants 👍
Till now I have never unit tested the routing part of the application. App.js mostly defines the routes. Do you guys think its good to test that? And if yes, then what exactly should we test? |
@linux-nerd I don't think is worth testing the router, after all it's already tested in their own repo. Let's remove that test. |
It looks like everything went well in the build, but still is showing as failed. I think that's because the bundle analyzer is running an http server. Maybe we can send a parameter in the CI to avoid running the analyzer there. I've seen that there's an option to add a custom script, we might be able to send a parameter to enable the analyzer whenever we would like to generate it, can you take a look? Maybe something like this:
Another option is to take a look at the parameters received by |
sure, I will look at it tomorrow :) |
package.json
Outdated
@@ -38,14 +39,16 @@ | |||
"**/src/**/*.js": [ | |||
"prettier --write", | |||
"eslint --fix", | |||
"git add" | |||
"git add", | |||
"test" |
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.
This should be test:staged
instead of just test
, right?
Also, we should have test script before git add
, so that we make sure that git add
only happens if the tests passed successfully.
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.
Looks good to me. It would be great if we could merge this PR asap, so that all other PR related CI builds and the main dev build start working fine.
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.
Awesome job! Thanks for taking the time to fix these issues!!
Details
Description
I tried solving this issue in my PR #135, but it seems it requires some discussion. So, instead of blocking that PR I created a new one.
Unit test is failing for App.test.js. I have a strong feeling that the test is failing because of @react/router. Their documentation does not say anything about testing with reach router. I would appreciate any help in this regards.Failing test case -
Issue
#134