-
Notifications
You must be signed in to change notification settings - Fork 8
Unit tests and linting in CI/CD [DEVOPS-408] #854
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
Open
soar
wants to merge
27
commits into
develop
Choose a base branch
from
feature/cicd-tests
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
26d653e
Change path for coverage reports
soar f09ab29
Add two build tasks: for linting and tests
soar f34e9e9
Merge branch 'develop' into feature/cicd-tests
soar 4f7a3c0
Resolve conflicts
IViol f877b41
Merge branch 'develop' into feature/cicd-tests
58b89df
Add enzyme helpers for lingui
087e520
Fix context errors in tests
141afaf
Fix tests
e03c3cd
Add module resolution path from project root
dc0e6ca
Use enzyme helper for lingui
80e4bde
Fix selectors to work properly with enzyme
65b183e
Bump enzyme-adapter-react version
ac63fd2
Merge branch 'develop' into feature/cicd-tests
64a16c8
Fix NewPasswordField test
IViol 51178bb
Fix store/plugins import/export declarations
IViol 3ca089f
Update components import/export
IViol 7fc89da
Fix FieldPreview tests
IViol bad2014
Resolve conflicts
IViol 93f0124
Fix JAssetSymbol component
IViol 1a8023e
Fix JAssetSymbol tests
IViol f76118e
Merge branch 'develop' into feature/cicd-tests
IViol 6981e9d
Fix import/export
IViol 1d807d8
Resolve conflicts
IViol da2b15d
Update lockfile
IViol bba2db9
Add 'i18n/lingui' mock
IViol 979873d
Update getAddressName tests
IViol 3600614
Fix reports paths in Jenkinsfile
IViol File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| import React from 'react' | ||
| import { shape, object } from 'prop-types' | ||
| import { mount, shallow } from 'enzyme' | ||
| import { I18nProvider } from '@lingui/react' | ||
|
|
||
| // Create the I18nProvider to retrieve context for wrapping around. | ||
| const language = 'en' | ||
| const intlProvider = new I18nProvider({ | ||
| language, | ||
| catalogs: { | ||
| [language]: {} | ||
| } | ||
| }, {}) | ||
|
|
||
| const { | ||
| linguiPublisher: { | ||
| i18n: originalI18n | ||
| } | ||
| } = intlProvider.getChildContext() | ||
|
|
||
| // You customize the i18n object here: | ||
| const i18n = { | ||
| ...originalI18n, | ||
| _: key => key // provide _ macro, for just passing down the key | ||
| } | ||
|
|
||
| /** | ||
| * When using Lingui `withI18n` on components, props.i18n is required. | ||
| */ | ||
| function nodeWithI18nProp(node) { | ||
| return React.cloneElement(node, { i18n }) | ||
| } | ||
|
|
||
| /* | ||
| * Methods to use | ||
| */ | ||
| export function shallowWithIntl(node, { context } = {}) { | ||
| return shallow( | ||
| nodeWithI18nProp(node), | ||
| { | ||
| context: Object.assign({}, context, { i18n }) | ||
| } | ||
| ) | ||
| } | ||
|
|
||
| export function mountWithIntl(node, { context, childContextTypes } = {}) { | ||
| const newContext = Object.assign({}, context, { linguiPublisher: { i18n } }) | ||
| /* | ||
| * I18nProvider sets the linguiPublisher in the context for withI18n to get | ||
| * the i18n object from. | ||
| */ | ||
| const newChildContextTypes = Object.assign({}, | ||
| { | ||
| linguiPublisher: shape({ | ||
| i18n: object.isRequired | ||
| }).isRequired | ||
| }, | ||
| childContextTypes | ||
| ) | ||
| return mount( | ||
| nodeWithI18nProp(node), | ||
| { | ||
| context: newContext, | ||
| childContextTypes: newChildContextTypes | ||
| } | ||
| ) | ||
| } |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@soar Should it be
/usr/src/app? Looks more like just/app.