-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from StratoDem/5-error-messages
5 error messages
- Loading branch information
Showing
8 changed files
with
146 additions
and
15 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -17,3 +17,4 @@ pip-selfcheck.json | |
*.egg-info/ | ||
*.whl | ||
venv/ | ||
dist/ |
This file contains 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,50 @@ | ||
# CHANGELOG | ||
|
||
## 1.2.0 - 2018-05-15 | ||
### Changed | ||
- Improves clarity of error messages for large component comparisons | ||
##### Old logic: | ||
raise `AssertionError` with large string difference between JSON objects if the component did not match the snapshot, which led to difficult to read error message like: | ||
``` | ||
AssertionError: {'pro[136 chars]en': 'another one'}, 'namespace': 'dash_html_c[77 chars]Div'} != {'pro[136 chars]en': [1, 2, 3]}, 'namespace': 'dash_html_compo[73 chars]Div'} | ||
``` | ||
##### New logic: | ||
raise `AssertionError` with large string difference between JSON objects if the component does not match the snapshot, **and** | ||
add new details section about the **first local mismatch** between the component and snapshot: | ||
``` | ||
DETAILS: | ||
<class 'list'> != <class 'str'> | ||
CONTEXT 1: | ||
{"children": [1, 2, 3]} | ||
CONTEXT 2: | ||
{"children": "another one"} | ||
``` | ||
or | ||
``` | ||
DETAILS: | ||
P != Span | ||
CONTEXT 1: | ||
{"type": "P", "props": {"children": "another one"}, "namespace": "dash_html_components"} | ||
CONTEXT 2: | ||
{"type": "Span", "props": {"children": "another one"}, "namespace": "dash_html_components"} | ||
``` | ||
|
||
## 1.1.0 - 2018-04-11 | ||
### Added | ||
- This package now checks for an environment variable (UPDATE_DASH_SNAPSHOTS) and will automatically overwrite snapshots if it is set to TRUE | ||
|
||
## 1.0.1 - 2018-03-27 | ||
### Added | ||
- MIT License | ||
|
||
## 1.0.0 - 2018-03-27 | ||
### Added | ||
- Initial publication |
This file contains 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
1 change: 1 addition & 0 deletions
1
snapshot_test/__tests__/__snapshots_2__/MyOtherUnitTestCase-my-test-unique-id.json
This file contains 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 @@ | ||
{"namespace": "dash_html_components", "type": "Div", "props": {"children": [{"namespace": "dash_html_components", "type": "P", "props": {"children": "wow"}}, {"namespace": "dash_html_components", "type": "Span", "props": {"children": "another one"}}], "id": "test-id"}} |
1 change: 1 addition & 0 deletions
1
snapshot_test/__tests__/__snapshots__/MyUnitTestCase-my-test-unique-id.json
This file contains 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 @@ | ||
{"namespace": "dash_html_components", "type": "Div", "props": {"children": [{"namespace": "dash_html_components", "type": "P", "props": {"children": "wow!"}}, {"namespace": "dash_html_components", "type": "Span", "props": {"children": "this works"}}], "id": "test-id"}} |
This file contains 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 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