From 30f3e2053a98cfc828800fd061320e61364e52fc Mon Sep 17 00:00:00 2001 From: Yelaman Yelmuratov Date: Mon, 1 Jul 2024 00:00:34 +0500 Subject: [PATCH] . d snippets only for approval_tests --- README.md | 18 ++---------------- packages/approval_tests_flutter/README.md | 18 ++---------------- 2 files changed, 4 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 7b3dbba..06ff899 100644 --- a/README.md +++ b/README.md @@ -152,8 +152,6 @@ After running the command, the files will be analyzed and you will be asked to c #### • Via approveResult property If you want the result to be automatically saved after running the test, you need to use the `approveResult` property in `Options`: - - ```dart void main() { test('test JSON object', () { @@ -172,13 +170,10 @@ void main() { }); } ``` -snippet source | anchor - this will result in the following file `example_test.test_JSON_object.approved.txt` - - + ```txt { "name": "JsonTest", @@ -189,8 +184,6 @@ this will result in the following file "version": 0.1 } ``` -snippet source | anchor - #### • Via file rename You can just rename the `.received` file to `.approved`. @@ -233,8 +226,6 @@ And the `verify_methods` folder has small examples of using different `ApprovalT ### JSON example With `verifyAsJson`, if you pass data models as `JsonItem`, with nested other models as `AnotherItem` and `SubItem`, then you need to add an `toJson` method to each model for the serialization to succeed. - - ```dart void main() { const jsonItem = JsonItem( @@ -264,13 +255,10 @@ void main() { }); } ``` -snippet source | anchor - this will result in the following file `verify_as_json_test.verify_model.approved.txt` - - + ```txt { "jsonItem": { @@ -297,8 +285,6 @@ this will result in the following file } } ``` -snippet source | anchor - Passed test example diff --git a/packages/approval_tests_flutter/README.md b/packages/approval_tests_flutter/README.md index a966e00..ee0632b 100644 --- a/packages/approval_tests_flutter/README.md +++ b/packages/approval_tests_flutter/README.md @@ -151,8 +151,6 @@ After running the command, the files will be analyzed and you will be asked to c #### • Via approveResult property If you want the result to be automatically saved after running the test, you need to use the `approveResult` property in `Options`: - - ```dart void main() { test('test JSON object', () { @@ -171,13 +169,9 @@ void main() { }); } ``` -snippet source | anchor - this will result in the following file `example_test.test_JSON_object.approved.txt` - - ```txt { "name": "JsonTest", @@ -188,8 +182,6 @@ this will result in the following file "version": 0.1 } ``` -snippet source | anchor - #### • Via file rename You can just rename the `.received` file to `.approved`. @@ -232,8 +224,6 @@ And the `verify_methods` folder has small examples of using different `ApprovalT ### JSON example With `verifyAsJson`, if you pass data models as `JsonItem`, with nested other models as `AnotherItem` and `SubItem`, then you need to add an `toJson` method to each model for the serialization to succeed. - - ```dart void main() { const jsonItem = JsonItem( @@ -263,13 +253,11 @@ void main() { }); } ``` -snippet source | anchor - + this will result in the following file `verify_as_json_test.verify_model.approved.txt` - - + ```txt { "jsonItem": { @@ -296,8 +284,6 @@ this will result in the following file } } ``` -snippet source | anchor - Passed test example