From 6396d05b258e3ed484a9449cc6b85c722fa00ac9 Mon Sep 17 00:00:00 2001 From: Mitch Spano Date: Sat, 26 Apr 2025 19:59:43 -0500 Subject: [PATCH 1/7] Update Deno dependencies and enhance argument processing - Bump versions of several Deno standard libraries in deno.json and deno.lock for improved functionality and security. - Refactor argument processing in ArgumentProcessor to validate GitHub Action configurations, ensuring required parameters are set correctly. - Replace Node.js file system operations with Deno's native file system methods for better compatibility. - Add comprehensive tests for GitHub Action mode validation in argument_processor_test.ts to ensure correct error handling. - Update UML writing logic in uml_writer.ts to utilize Deno's file system methods, enhancing performance and reliability. - Refactor XML reading logic in xml_reader.ts to use Deno's file system methods, improving error handling and compatibility. --- deno.json | 26 +++- deno.lock | 206 +++++++++++++++++++++++----- src/main/argument_processor.ts | 41 +++++- src/main/uml_writer.ts | 20 +-- src/main/xml_reader.ts | 16 +-- src/test/argument_processor_test.ts | 79 +++++++++++ src/test/uml_writer_test.ts | 28 +++- 7 files changed, 349 insertions(+), 67 deletions(-) diff --git a/deno.json b/deno.json index 364655f..ba716c2 100644 --- a/deno.json +++ b/deno.json @@ -6,13 +6,31 @@ "imports": { "@actions/github": "npm:@actions/github@^6.0.0", "@octokit/core": "npm:@octokit/core@^6.1.4", - "@std/assert": "jsr:@std/assert@^1.0.10", - "@std/cli": "jsr:@std/cli@^1.0.9", - "@std/path": "jsr:@std/path@^1.0.8", - "@std/testing": "jsr:@std/testing@^1.0.8", + "@std/assert": "jsr:@std/assert@^1.0.13", + "@std/cli": "jsr:@std/cli@^1.0.17", + "@std/fs": "jsr:@std/fs@^1.0.17", + "@std/path": "jsr:@std/path@^1.0.9", + "@std/testing": "jsr:@std/testing@^1.0.11", "@types/node": "npm:@types/node@^22.10.2", "jasmine": "npm:jasmine@^5.5.0", "xml2js": "npm:xml2js@^0.6.2", "yargs": "npm:yargs@^17.7.2" + }, + "compilerOptions": { + "allowJs": true, + "lib": ["deno.window"], + "strict": true, + "types": ["deno"] + }, + "tasks": { + "test": "deno test --allow-read --allow-env" + }, + "fmt": { + "lineWidth": 80, + "indentWidth": 2, + "useTabs": false, + "semiColons": true, + "singleQuote": false, + "proseWrap": "preserve" } } diff --git a/deno.lock b/deno.lock index 43f206c..67435a7 100644 --- a/deno.lock +++ b/deno.lock @@ -1,14 +1,16 @@ { "version": "4", "specifiers": { - "jsr:@std/assert@^1.0.10": "1.0.10", - "jsr:@std/cli@*": "1.0.9", - "jsr:@std/cli@^1.0.9": "1.0.9", - "jsr:@std/data-structures@^1.0.5": "1.0.5", - "jsr:@std/fs@^1.0.8": "1.0.8", - "jsr:@std/internal@^1.0.5": "1.0.5", - "jsr:@std/path@^1.0.8": "1.0.8", - "jsr:@std/testing@^1.0.8": "1.0.8", + "jsr:@std/assert@^1.0.12": "1.0.13", + "jsr:@std/assert@^1.0.13": "1.0.13", + "jsr:@std/cli@^1.0.17": "1.0.17", + "jsr:@std/data-structures@^1.0.6": "1.0.7", + "jsr:@std/fs@^1.0.16": "1.0.17", + "jsr:@std/fs@^1.0.17": "1.0.17", + "jsr:@std/internal@^1.0.6": "1.0.6", + "jsr:@std/path@^1.0.8": "1.0.9", + "jsr:@std/path@^1.0.9": "1.0.9", + "jsr:@std/testing@^1.0.11": "1.0.11", "npm:@actions/github@*": "6.0.0_@octokit+core@5.2.0", "npm:@actions/github@6": "6.0.0_@octokit+core@5.2.0", "npm:@octokit/core@*": "6.1.4", @@ -20,38 +22,38 @@ "npm:yargs@^17.7.2": "17.7.2" }, "jsr": { - "@std/assert@1.0.10": { - "integrity": "59b5cbac5bd55459a19045d95cc7c2ff787b4f8527c0dd195078ff6f9481fbb3", + "@std/assert@1.0.13": { + "integrity": "ae0d31e41919b12c656c742b22522c32fb26ed0cba32975cb0de2a273cb68b29", "dependencies": [ "jsr:@std/internal" ] }, - "@std/cli@1.0.9": { - "integrity": "557e5865af000efbf3f737dcfea5b8ab86453594f4a9cd8d08c9fa83d8e3f3bc" + "@std/cli@1.0.17": { + "integrity": "e15b9abe629e17be90cc6216327f03a29eae613365f1353837fa749aad29ce7b" }, - "@std/data-structures@1.0.5": { - "integrity": "86dd5c2d6365a6ad56e9103b3a877c5d5ade238c68ae463acfe0eb0e56d40783" + "@std/data-structures@1.0.7": { + "integrity": "16932d2c8d281f65eaaa2209af2473209881e33b1ced54cd1b015e7b4cdbb0d2" }, - "@std/fs@1.0.8": { - "integrity": "161c721b6f9400b8100a851b6f4061431c538b204bb76c501d02c508995cffe0", + "@std/fs@1.0.17": { + "integrity": "1c00c632677c1158988ef7a004cb16137f870aafdb8163b9dce86ec652f3952b", "dependencies": [ - "jsr:@std/path" + "jsr:@std/path@^1.0.9" ] }, - "@std/internal@1.0.5": { - "integrity": "54a546004f769c1ac9e025abd15a76b6671ddc9687e2313b67376125650dc7ba" + "@std/internal@1.0.6": { + "integrity": "9533b128f230f73bd209408bb07a4b12f8d4255ab2a4d22a1fd6d87304aca9a4" }, - "@std/path@1.0.8": { - "integrity": "548fa456bb6a04d3c1a1e7477986b6cffbce95102d0bb447c67c4ee70e0364be" + "@std/path@1.0.9": { + "integrity": "260a49f11edd3db93dd38350bf9cd1b4d1366afa98e81b86167b4e3dd750129e" }, - "@std/testing@1.0.8": { - "integrity": "ceef535808fb7568e91b0f8263599bd29b1c5603ffb0377227f00a8ca9fe42a2", + "@std/testing@1.0.11": { + "integrity": "12b3db12d34f0f385a26248933bde766c0f8c5ad8b6ab34d4d38f528ab852f48", "dependencies": [ - "jsr:@std/assert", + "jsr:@std/assert@^1.0.12", "jsr:@std/data-structures", - "jsr:@std/fs", + "jsr:@std/fs@^1.0.16", "jsr:@std/internal", - "jsr:@std/path" + "jsr:@std/path@^1.0.8" ] } }, @@ -78,12 +80,12 @@ "@isaacs/cliui@8.0.2": { "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", "dependencies": [ - "string-width@5.1.2", "string-width-cjs@npm:string-width@4.2.3", - "strip-ansi@7.1.0", + "string-width@5.1.2", "strip-ansi-cjs@npm:strip-ansi@6.0.1", - "wrap-ansi@8.1.0", - "wrap-ansi-cjs@npm:wrap-ansi@7.0.0" + "strip-ansi@7.1.0", + "wrap-ansi-cjs@npm:wrap-ansi@7.0.0", + "wrap-ansi@8.1.0" ] }, "@octokit/auth-token@4.0.0": { @@ -97,8 +99,8 @@ "dependencies": [ "@octokit/auth-token@4.0.0", "@octokit/graphql@7.1.1", - "@octokit/request@8.4.1", "@octokit/request-error@5.1.1", + "@octokit/request@8.4.1", "@octokit/types@13.8.0", "before-after-hook@2.2.3", "universal-user-agent@6.0.1" @@ -109,8 +111,8 @@ "dependencies": [ "@octokit/auth-token@5.1.2", "@octokit/graphql@8.2.1", - "@octokit/request@9.2.2", "@octokit/request-error@6.1.7", + "@octokit/request@9.2.2", "@octokit/types@13.8.0", "before-after-hook@3.0.2", "universal-user-agent@7.0.2" @@ -638,6 +640,137 @@ "https://deno.land/std@0.217.0/assert/unreachable.ts": "38cfecb95d8b06906022d2f9474794fca4161a994f83354fd079cac9032b5145", "https://deno.land/std@0.217.0/fmt/colors.ts": "d239d84620b921ea520125d778947881f62c50e78deef2657073840b8af9559a", "https://deno.land/std@0.217.0/testing/mock.ts": "dc9e58f88f7e746edd0c551443a39096c75895a0fdcd7db62777e47787be6226", + "https://deno.land/std@0.220.1/assert/_constants.ts": "a271e8ef5a573f1df8e822a6eb9d09df064ad66a4390f21b3e31f820a38e0975", + "https://deno.land/std@0.220.1/assert/_diff.ts": "4bf42969aa8b1a33aaf23eb8e478b011bfaa31b82d85d2ff4b5c4662d8780d2b", + "https://deno.land/std@0.220.1/assert/_format.ts": "0ba808961bf678437fb486b56405b6fefad2cf87b5809667c781ddee8c32aff4", + "https://deno.land/std@0.220.1/assert/assert.ts": "bec068b2fccdd434c138a555b19a2c2393b71dfaada02b7d568a01541e67cdc5", + "https://deno.land/std@0.220.1/assert/assert_almost_equals.ts": "8b96b7385cc117668b0720115eb6ee73d04c9bcb2f5d2344d674918c9113688f", + "https://deno.land/std@0.220.1/assert/assert_array_includes.ts": "1688d76317fd45b7e93ef9e2765f112fdf2b7c9821016cdfb380b9445374aed1", + "https://deno.land/std@0.220.1/assert/assert_equals.ts": "4497c56fe7d2993b0d447926702802fc0becb44e319079e8eca39b482ee01b4e", + "https://deno.land/std@0.220.1/assert/assert_exists.ts": "24a7bf965e634f909242cd09fbaf38bde6b791128ece08e33ab08586a7cc55c9", + "https://deno.land/std@0.220.1/assert/assert_false.ts": "6f382568e5128c0f855e5f7dbda8624c1ed9af4fcc33ef4a9afeeedcdce99769", + "https://deno.land/std@0.220.1/assert/assert_greater.ts": "4945cf5729f1a38874d7e589e0fe5cc5cd5abe5573ca2ddca9d3791aa891856c", + "https://deno.land/std@0.220.1/assert/assert_greater_or_equal.ts": "573ed8823283b8d94b7443eb69a849a3c369a8eb9666b2d1db50c33763a5d219", + "https://deno.land/std@0.220.1/assert/assert_instance_of.ts": "72dc1faff1e248692d873c89382fa1579dd7b53b56d52f37f9874a75b11ba444", + "https://deno.land/std@0.220.1/assert/assert_is_error.ts": "6596f2b5ba89ba2fe9b074f75e9318cda97a2381e59d476812e30077fbdb6ed2", + "https://deno.land/std@0.220.1/assert/assert_less.ts": "2b4b3fe7910f65f7be52212f19c3977ecb8ba5b2d6d0a296c83cde42920bb005", + "https://deno.land/std@0.220.1/assert/assert_less_or_equal.ts": "b93d212fe669fbde959e35b3437ac9a4468f2e6b77377e7b6ea2cfdd825d38a0", + "https://deno.land/std@0.220.1/assert/assert_match.ts": "ec2d9680ed3e7b9746ec57ec923a17eef6d476202f339ad91d22277d7f1d16e1", + "https://deno.land/std@0.220.1/assert/assert_not_equals.ts": "ac86413ab70ffb14fdfc41740ba579a983fe355ba0ce4a9ab685e6b8e7f6a250", + "https://deno.land/std@0.220.1/assert/assert_not_instance_of.ts": "8f720d92d83775c40b2542a8d76c60c2d4aeddaf8713c8d11df8984af2604931", + "https://deno.land/std@0.220.1/assert/assert_not_match.ts": "b4b7c77f146963e2b673c1ce4846473703409eb93f5ab0eb60f6e6f8aeffe39f", + "https://deno.land/std@0.220.1/assert/assert_not_strict_equals.ts": "da0b8ab60a45d5a9371088378e5313f624799470c3b54c76e8b8abeec40a77be", + "https://deno.land/std@0.220.1/assert/assert_object_match.ts": "e85e5eef62a56ce364c3afdd27978ccab979288a3e772e6855c270a7b118fa49", + "https://deno.land/std@0.220.1/assert/assert_rejects.ts": "5206ac37d883797d9504e3915a0c7b692df6efcdefff3889cc14bb5a325641dd", + "https://deno.land/std@0.220.1/assert/assert_strict_equals.ts": "0425a98f70badccb151644c902384c12771a93e65f8ff610244b8147b03a2366", + "https://deno.land/std@0.220.1/assert/assert_string_includes.ts": "dfb072a890167146f8e5bdd6fde887ce4657098e9f71f12716ef37f35fb6f4a7", + "https://deno.land/std@0.220.1/assert/assert_throws.ts": "31f3c061338aec2c2c33731973d58ccd4f14e42f355501541409ee958d2eb8e5", + "https://deno.land/std@0.220.1/assert/assertion_error.ts": "9f689a101ee586c4ce92f52fa7ddd362e86434ffdf1f848e45987dc7689976b8", + "https://deno.land/std@0.220.1/assert/equal.ts": "fae5e8a52a11d3ac694bbe1a53e13a7969e3f60791262312e91a3e741ae519e2", + "https://deno.land/std@0.220.1/assert/fail.ts": "f310e51992bac8e54f5fd8e44d098638434b2edb802383690e0d7a9be1979f1c", + "https://deno.land/std@0.220.1/assert/mod.ts": "7e41449e77a31fef91534379716971bebcfc12686e143d38ada5438e04d4a90e", + "https://deno.land/std@0.220.1/assert/unimplemented.ts": "47ca67d1c6dc53abd0bd729b71a31e0825fc452dbcd4fde4ca06789d5644e7fd", + "https://deno.land/std@0.220.1/assert/unreachable.ts": "3670816a4ab3214349acb6730e3e6f5299021234657eefe05b48092f3848c270", + "https://deno.land/std@0.220.1/cli/mod.ts": "3ac44ca5def1b8cc1089a748d4904de8aa80fd89aa16a5d0bebee9cdcbdadba1", + "https://deno.land/std@0.220.1/cli/parse_args.ts": "a9e4ae8dbd0a96ad974d2f645af8143433103a17161a73dd5c2a03517bf6429d", + "https://deno.land/std@0.220.1/cli/prompt_secret.ts": "f6c9416b261131ac0df7ec4c57d4dc3aac7566b8a840a2d4388f8b7424f57b22", + "https://deno.land/std@0.220.1/cli/spinner.ts": "cf873605771270b4324cc063b5031ab250d8efee8799e45e1a3bfdd333ff721d", + "https://deno.land/std@0.220.1/fmt/colors.ts": "d239d84620b921ea520125d778947881f62c50e78deef2657073840b8af9559a", + "https://deno.land/std@0.220.1/fs/_create_walk_entry.ts": "5d9d2aaec05bcf09a06748b1684224d33eba7a4de24cf4cf5599991ca6b5b412", + "https://deno.land/std@0.220.1/fs/_get_file_info_type.ts": "da7bec18a7661dba360a1db475b826b18977582ce6fc9b25f3d4ee0403fe8cbd", + "https://deno.land/std@0.220.1/fs/_is_same_path.ts": "709c95868345fea051c58b9e96af95cff94e6ae98dfcff2b66dee0c212c4221f", + "https://deno.land/std@0.220.1/fs/_is_subdir.ts": "c68b309d46cc8568ed83c000f608a61bbdba0943b7524e7a30f9e450cf67eecd", + "https://deno.land/std@0.220.1/fs/_to_path_string.ts": "29bfc9c6c112254961d75cbf6ba814d6de5349767818eb93090cecfa9665591e", + "https://deno.land/std@0.220.1/fs/copy.ts": "dc0f68c4b6c3b090bfdb909387e309f6169b746bd713927c9507c9ef545d71f6", + "https://deno.land/std@0.220.1/fs/empty_dir.ts": "4f01e6d56e2aa8d90ad60f20bc25601f516b00f6c3044cdf6863a058791d91aa", + "https://deno.land/std@0.220.1/fs/ensure_dir.ts": "dffff68de0d10799b5aa9e39dec4e327e12bbd29e762292193684542648c4aeb", + "https://deno.land/std@0.220.1/fs/ensure_file.ts": "ac5cfde94786b0284d2c8e9f7f9425269bea1b2140612b4aea1f20b508870f59", + "https://deno.land/std@0.220.1/fs/ensure_link.ts": "d42af2edefeaa9817873ec6e46dc5d209ac4d744f8c69c5ecc2dffade78465b6", + "https://deno.land/std@0.220.1/fs/ensure_symlink.ts": "1f64d7bdd191f7d9b71264e191902fcae5cec86305d54659897944caea70f814", + "https://deno.land/std@0.220.1/fs/eol.ts": "c9807291f78361d49fd986a9be04654610c615c5e2ec63d748976197d30ff206", + "https://deno.land/std@0.220.1/fs/exists.ts": "d2757ef764eaf5c6c5af7228e8447db2de42ab084a2dae540097f905723d83f5", + "https://deno.land/std@0.220.1/fs/expand_glob.ts": "a1ce02b05ed7b96985b0665067c9f1018f3f2ade7ee0fb0d629231050260b158", + "https://deno.land/std@0.220.1/fs/mod.ts": "107f5afa4424c2d3ce2f7e9266173198da30302c69af662c720115fe504dc5ee", + "https://deno.land/std@0.220.1/fs/move.ts": "39e0d7ccb88a566d20b949712020e766b15ef1ec19159573d11f949bd677909c", + "https://deno.land/std@0.220.1/fs/walk.ts": "78e1d01a9f75715614bf8d6e58bd77d9fafb1222c41194e607cd3849d7a0e771", + "https://deno.land/std@0.220.1/path/_common/assert_path.ts": "dbdd757a465b690b2cc72fc5fb7698c51507dec6bfafce4ca500c46b76ff7bd8", + "https://deno.land/std@0.220.1/path/_common/basename.ts": "569744855bc8445f3a56087fd2aed56bdad39da971a8d92b138c9913aecc5fa2", + "https://deno.land/std@0.220.1/path/_common/common.ts": "ef73c2860694775fe8ffcbcdd387f9f97c7a656febf0daa8c73b56f4d8a7bd4c", + "https://deno.land/std@0.220.1/path/_common/constants.ts": "dc5f8057159f4b48cd304eb3027e42f1148cf4df1fb4240774d3492b5d12ac0c", + "https://deno.land/std@0.220.1/path/_common/dirname.ts": "684df4aa71a04bbcc346c692c8485594fc8a90b9408dfbc26ff32cf3e0c98cc8", + "https://deno.land/std@0.220.1/path/_common/format.ts": "92500e91ea5de21c97f5fe91e178bae62af524b72d5fcd246d6d60ae4bcada8b", + "https://deno.land/std@0.220.1/path/_common/from_file_url.ts": "d672bdeebc11bf80e99bf266f886c70963107bdd31134c4e249eef51133ceccf", + "https://deno.land/std@0.220.1/path/_common/glob_to_reg_exp.ts": "6cac16d5c2dc23af7d66348a7ce430e5de4e70b0eede074bdbcf4903f4374d8d", + "https://deno.land/std@0.220.1/path/_common/normalize.ts": "684df4aa71a04bbcc346c692c8485594fc8a90b9408dfbc26ff32cf3e0c98cc8", + "https://deno.land/std@0.220.1/path/_common/normalize_string.ts": "33edef773c2a8e242761f731adeb2bd6d683e9c69e4e3d0092985bede74f4ac3", + "https://deno.land/std@0.220.1/path/_common/relative.ts": "faa2753d9b32320ed4ada0733261e3357c186e5705678d9dd08b97527deae607", + "https://deno.land/std@0.220.1/path/_common/strip_trailing_separators.ts": "7024a93447efcdcfeaa9339a98fa63ef9d53de363f1fbe9858970f1bba02655a", + "https://deno.land/std@0.220.1/path/_common/to_file_url.ts": "7f76adbc83ece1bba173e6e98a27c647712cab773d3f8cbe0398b74afc817883", + "https://deno.land/std@0.220.1/path/_interface.ts": "a1419fcf45c0ceb8acdccc94394e3e94f99e18cfd32d509aab514c8841799600", + "https://deno.land/std@0.220.1/path/_os.ts": "8fb9b90fb6b753bd8c77cfd8a33c2ff6c5f5bc185f50de8ca4ac6a05710b2c15", + "https://deno.land/std@0.220.1/path/basename.ts": "5d341aadb7ada266e2280561692c165771d071c98746fcb66da928870cd47668", + "https://deno.land/std@0.220.1/path/common.ts": "03e52e22882402c986fe97ca3b5bb4263c2aa811c515ce84584b23bac4cc2643", + "https://deno.land/std@0.220.1/path/constants.ts": "0c206169ca104938ede9da48ac952de288f23343304a1c3cb6ec7625e7325f36", + "https://deno.land/std@0.220.1/path/dirname.ts": "85bd955bf31d62c9aafdd7ff561c4b5fb587d11a9a5a45e2b01aedffa4238a7c", + "https://deno.land/std@0.220.1/path/extname.ts": "593303db8ae8c865cbd9ceec6e55d4b9ac5410c1e276bfd3131916591b954441", + "https://deno.land/std@0.220.1/path/format.ts": "42a2f3201343df77061207e6aaf78c95bafce7f711dcb7fe1e5840311c505778", + "https://deno.land/std@0.220.1/path/from_file_url.ts": "911833ae4fd10a1c84f6271f36151ab785955849117dc48c6e43b929504ee069", + "https://deno.land/std@0.220.1/path/glob_to_regexp.ts": "7f30f0a21439cadfdae1be1bf370880b415e676097fda584a63ce319053b5972", + "https://deno.land/std@0.220.1/path/is_absolute.ts": "4791afc8bfd0c87f0526eaa616b0d16e7b3ab6a65b62942e50eac68de4ef67d7", + "https://deno.land/std@0.220.1/path/is_glob.ts": "a65f6195d3058c3050ab905705891b412ff942a292bcbaa1a807a74439a14141", + "https://deno.land/std@0.220.1/path/join.ts": "ae2ec5ca44c7e84a235fd532e4a0116bfb1f2368b394db1c4fb75e3c0f26a33a", + "https://deno.land/std@0.220.1/path/join_globs.ts": "5b3bf248b93247194f94fa6947b612ab9d3abd571ca8386cf7789038545e54a0", + "https://deno.land/std@0.220.1/path/mod.ts": "2821a1bb3a4148a0ffe79c92aa41aa9319fef73c6d6f5178f52b2c720d3eb02d", + "https://deno.land/std@0.220.1/path/normalize.ts": "4155743ccceeed319b350c1e62e931600272fad8ad00c417b91df093867a8352", + "https://deno.land/std@0.220.1/path/normalize_glob.ts": "cc89a77a7d3b1d01053b9dcd59462b75482b11e9068ae6c754b5cf5d794b374f", + "https://deno.land/std@0.220.1/path/parse.ts": "65e8e285f1a63b714e19ef24b68f56e76934c3df0b6e65fd440d3991f4f8aefb", + "https://deno.land/std@0.220.1/path/posix/_util.ts": "1e3937da30f080bfc99fe45d7ed23c47dd8585c5e473b2d771380d3a6937cf9d", + "https://deno.land/std@0.220.1/path/posix/basename.ts": "d2fa5fbbb1c5a3ab8b9326458a8d4ceac77580961b3739cd5bfd1d3541a3e5f0", + "https://deno.land/std@0.220.1/path/posix/common.ts": "26f60ccc8b2cac3e1613000c23ac5a7d392715d479e5be413473a37903a2b5d4", + "https://deno.land/std@0.220.1/path/posix/constants.ts": "93481efb98cdffa4c719c22a0182b994e5a6aed3047e1962f6c2c75b7592bef1", + "https://deno.land/std@0.220.1/path/posix/dirname.ts": "76cd348ffe92345711409f88d4d8561d8645353ac215c8e9c80140069bf42f00", + "https://deno.land/std@0.220.1/path/posix/extname.ts": "e398c1d9d1908d3756a7ed94199fcd169e79466dd88feffd2f47ce0abf9d61d2", + "https://deno.land/std@0.220.1/path/posix/format.ts": "185e9ee2091a42dd39e2a3b8e4925370ee8407572cee1ae52838aed96310c5c1", + "https://deno.land/std@0.220.1/path/posix/from_file_url.ts": "951aee3a2c46fd0ed488899d024c6352b59154c70552e90885ed0c2ab699bc40", + "https://deno.land/std@0.220.1/path/posix/glob_to_regexp.ts": "76f012fcdb22c04b633f536c0b9644d100861bea36e9da56a94b9c589a742e8f", + "https://deno.land/std@0.220.1/path/posix/is_absolute.ts": "cebe561ad0ae294f0ce0365a1879dcfca8abd872821519b4fcc8d8967f888ede", + "https://deno.land/std@0.220.1/path/posix/is_glob.ts": "8a8b08c08bf731acf2c1232218f1f45a11131bc01de81e5f803450a5914434b9", + "https://deno.land/std@0.220.1/path/posix/join.ts": "7fc2cb3716aa1b863e990baf30b101d768db479e70b7313b4866a088db016f63", + "https://deno.land/std@0.220.1/path/posix/join_globs.ts": "a9475b44645feddceb484ee0498e456f4add112e181cb94042cdc6d47d1cdd25", + "https://deno.land/std@0.220.1/path/posix/mod.ts": "2301fc1c54a28b349e20656f68a85f75befa0ee9b6cd75bfac3da5aca9c3f604", + "https://deno.land/std@0.220.1/path/posix/normalize.ts": "baeb49816a8299f90a0237d214cef46f00ba3e95c0d2ceb74205a6a584b58a91", + "https://deno.land/std@0.220.1/path/posix/normalize_glob.ts": "9c87a829b6c0f445d03b3ecadc14492e2864c3ebb966f4cea41e98326e4435c6", + "https://deno.land/std@0.220.1/path/posix/parse.ts": "0b1fc4cb890dbb699ec1d2c232d274843b4a7142e1ad976b69fe51c954eb6080", + "https://deno.land/std@0.220.1/path/posix/relative.ts": "3907d6eda41f0ff723d336125a1ad4349112cd4d48f693859980314d5b9da31c", + "https://deno.land/std@0.220.1/path/posix/resolve.ts": "08b699cfeee10cb6857ccab38fa4b2ec703b0ea33e8e69964f29d02a2d5257cf", + "https://deno.land/std@0.220.1/path/posix/to_file_url.ts": "7aa752ba66a35049e0e4a4be5a0a31ac6b645257d2e031142abb1854de250aaf", + "https://deno.land/std@0.220.1/path/posix/to_namespaced_path.ts": "28b216b3c76f892a4dca9734ff1cc0045d135532bfd9c435ae4858bfa5a2ebf0", + "https://deno.land/std@0.220.1/path/relative.ts": "ab739d727180ed8727e34ed71d976912461d98e2b76de3d3de834c1066667add", + "https://deno.land/std@0.220.1/path/resolve.ts": "a6f977bdb4272e79d8d0ed4333e3d71367cc3926acf15ac271f1d059c8494d8d", + "https://deno.land/std@0.220.1/path/to_file_url.ts": "88f049b769bce411e2d2db5bd9e6fd9a185a5fbd6b9f5ad8f52bef517c4ece1b", + "https://deno.land/std@0.220.1/path/to_namespaced_path.ts": "b706a4103b104cfadc09600a5f838c2ba94dbcdb642344557122dda444526e40", + "https://deno.land/std@0.220.1/path/windows/_util.ts": "d5f47363e5293fced22c984550d5e70e98e266cc3f31769e1710511803d04808", + "https://deno.land/std@0.220.1/path/windows/basename.ts": "e2dbf31d1d6385bfab1ce38c333aa290b6d7ae9e0ecb8234a654e583cf22f8fe", + "https://deno.land/std@0.220.1/path/windows/common.ts": "26f60ccc8b2cac3e1613000c23ac5a7d392715d479e5be413473a37903a2b5d4", + "https://deno.land/std@0.220.1/path/windows/constants.ts": "5afaac0a1f67b68b0a380a4ef391bf59feb55856aa8c60dfc01bd3b6abb813f5", + "https://deno.land/std@0.220.1/path/windows/dirname.ts": "33e421be5a5558a1346a48e74c330b8e560be7424ed7684ea03c12c21b627bc9", + "https://deno.land/std@0.220.1/path/windows/extname.ts": "165a61b00d781257fda1e9606a48c78b06815385e7d703232548dbfc95346bef", + "https://deno.land/std@0.220.1/path/windows/format.ts": "bbb5ecf379305b472b1082cd2fdc010e44a0020030414974d6029be9ad52aeb6", + "https://deno.land/std@0.220.1/path/windows/from_file_url.ts": "ced2d587b6dff18f963f269d745c4a599cf82b0c4007356bd957cb4cb52efc01", + "https://deno.land/std@0.220.1/path/windows/glob_to_regexp.ts": "e45f1f89bf3fc36f94ab7b3b9d0026729829fabc486c77f414caebef3b7304f8", + "https://deno.land/std@0.220.1/path/windows/is_absolute.ts": "4a8f6853f8598cf91a835f41abed42112cebab09478b072e4beb00ec81f8ca8a", + "https://deno.land/std@0.220.1/path/windows/is_glob.ts": "8a8b08c08bf731acf2c1232218f1f45a11131bc01de81e5f803450a5914434b9", + "https://deno.land/std@0.220.1/path/windows/join.ts": "8d03530ab89195185103b7da9dfc6327af13eabdcd44c7c63e42e27808f50ecf", + "https://deno.land/std@0.220.1/path/windows/join_globs.ts": "a9475b44645feddceb484ee0498e456f4add112e181cb94042cdc6d47d1cdd25", + "https://deno.land/std@0.220.1/path/windows/mod.ts": "2301fc1c54a28b349e20656f68a85f75befa0ee9b6cd75bfac3da5aca9c3f604", + "https://deno.land/std@0.220.1/path/windows/normalize.ts": "78126170ab917f0ca355a9af9e65ad6bfa5be14d574c5fb09bb1920f52577780", + "https://deno.land/std@0.220.1/path/windows/normalize_glob.ts": "9c87a829b6c0f445d03b3ecadc14492e2864c3ebb966f4cea41e98326e4435c6", + "https://deno.land/std@0.220.1/path/windows/parse.ts": "dbdfe2bc6db482d755b5f63f7207cd019240fcac02ad2efa582adf67ff10553a", + "https://deno.land/std@0.220.1/path/windows/relative.ts": "3e1abc7977ee6cc0db2730d1f9cb38be87b0ce4806759d271a70e4997fc638d7", + "https://deno.land/std@0.220.1/path/windows/resolve.ts": "8dae1dadfed9d46ff46cc337c9525c0c7d959fb400a6308f34595c45bdca1972", + "https://deno.land/std@0.220.1/path/windows/to_file_url.ts": "40e560ee4854fe5a3d4d12976cef2f4e8914125c81b11f1108e127934ced502e", + "https://deno.land/std@0.220.1/path/windows/to_namespaced_path.ts": "4ffa4fb6fae321448d5fe810b3ca741d84df4d7897e61ee29be961a6aac89a4c", + "https://deno.land/std@0.220.1/testing/mock.ts": "a963181c2860b6ba3eb60e08b62c164d33cf5da7cd445893499b2efda20074db", "https://deno.land/std@0.224.0/assert/_constants.ts": "a271e8ef5a573f1df8e822a6eb9d09df064ad66a4390f21b3e31f820a38e0975", "https://deno.land/std@0.224.0/assert/assert_equals.ts": "3bbca947d85b9d374a108687b1a8ba3785a7850436b5a8930d81f34a32cb8c74", "https://deno.land/std@0.224.0/assert/assert_is_error.ts": "f856b3bc978a7aa6a601f3fec6603491ab6255118afa6baa84b04426dd3cc491", @@ -652,10 +785,11 @@ }, "workspace": { "dependencies": [ - "jsr:@std/assert@^1.0.10", - "jsr:@std/cli@^1.0.9", - "jsr:@std/path@^1.0.8", - "jsr:@std/testing@^1.0.8", + "jsr:@std/assert@^1.0.13", + "jsr:@std/cli@^1.0.17", + "jsr:@std/fs@^1.0.17", + "jsr:@std/path@^1.0.9", + "jsr:@std/testing@^1.0.11", "npm:@actions/github@6", "npm:@octokit/core@^6.1.4", "npm:@types/node@^22.10.2", diff --git a/src/main/argument_processor.ts b/src/main/argument_processor.ts index e8d14ce..bf7f719 100644 --- a/src/main/argument_processor.ts +++ b/src/main/argument_processor.ts @@ -18,8 +18,8 @@ * @fileoverview This module processes command line arguments and returns an * object containing the arguments. */ -import * as fs from "node:fs"; -import { parseArgs } from "@std/cli/parse-args"; +import { existsSync } from "@std/fs"; +import { parseArgs } from "@std/cli"; const VALID_OUTPUT_FILE_NAME_REGEX = new RegExp("^[a-zA-Z0-9_]+$"); @@ -100,6 +100,12 @@ export const ERROR_MESSAGES = { ) }`, header: "The following errors were encountered:", + githubActionRequiresMermaid: + "GitHub Action mode requires diagramTool to be 'mermaid'", + githubActionRequiresHeadHash: + "GitHub Action mode requires gitDiffToHash to be 'HEAD'", + githubActionRequiresHeadMinusOne: + "GitHub Action mode requires gitDiffFromHash to be 'HEAD^1'", }; /** @@ -162,6 +168,11 @@ export class ArgumentProcessor { this.validateOutputFileName(); } + // Validate GitHub Action specific requirements + if (this.config.mode?.toLowerCase() === Mode.GITHUB_ACTION) { + this.validateGitHubActionMode(); + } + this.validateRequiredArguments(); this.validateMutuallyExclusiveArguments(); this.validateConditionalArguments(); @@ -196,7 +207,7 @@ export class ArgumentProcessor { return; } for (const filePath of this.config.filePath) { - if (!fs.existsSync(filePath)) { + if (!existsSync(filePath)) { this.errorsEncountered.push( ERROR_MESSAGES.filePathDoesNotExist(filePath), ); @@ -222,13 +233,27 @@ export class ArgumentProcessor { this.errorsEncountered.push(ERROR_MESSAGES.outputDirectoryRequired); return; } - if (!fs.existsSync(this.config.outputDirectory)) { + if (!existsSync(this.config.outputDirectory)) { this.errorsEncountered.push( ERROR_MESSAGES.invalidOutputDirectory(this.config.outputDirectory), ); } } + private validateGitHubActionMode() { + if (this.config.diagramTool?.toLowerCase() !== DiagramTool.MERMAID) { + this.errorsEncountered.push(ERROR_MESSAGES.githubActionRequiresMermaid); + } + if (this.config.gitDiffToHash !== "HEAD") { + this.errorsEncountered.push(ERROR_MESSAGES.githubActionRequiresHeadHash); + } + if (this.config.gitDiffFromHash !== "HEAD^1") { + this.errorsEncountered.push( + ERROR_MESSAGES.githubActionRequiresHeadMinusOne, + ); + } + } + private validateRequiredArguments() { if ( (!this.config.filePath || this.config?.filePath?.length === 0) && @@ -272,4 +297,12 @@ export class ArgumentProcessor { throw new Error(errors.join("\n")); } } + + /** + * Returns the list of errors encountered during argument validation. + * @returns An array of error messages + */ + getErrors(): string[] { + return this.errorsEncountered; + } } diff --git a/src/main/uml_writer.ts b/src/main/uml_writer.ts index 459a2fd..5f1c65f 100644 --- a/src/main/uml_writer.ts +++ b/src/main/uml_writer.ts @@ -18,8 +18,7 @@ * @fileoverview This file contains the UmlWriter class which is used to write * the generated UML diagrams to a file. */ -import * as fs from "node:fs"; -import * as path from "node:path"; +import { join } from "@std/path"; import { Configuration, Mode, RuntimeConfig } from "./argument_processor.ts"; import { FlowDifference } from "./flow_to_uml_transformer.ts"; import { GithubClient } from "./github_client.ts"; @@ -57,13 +56,16 @@ export class UmlWriter { } private writeJsonFile(config: RuntimeConfig) { - const fileBody = getFormatter().format(this.filePathToFlowDifference); - fs.writeFileSync( - path.join( - config.outputDirectory!, - `${config.outputFileName!}${FILE_EXTENSION}`, - ), - JSON.stringify(fileBody, null, 2), + const outputPath = join( + config.outputDirectory!, + `${config.outputFileName}${FILE_EXTENSION}`, + ); + const formattedDifferences = getFormatter().format( + this.filePathToFlowDifference, + ); + Deno.writeTextFileSync( + outputPath, + JSON.stringify(formattedDifferences, null, 2), ); } diff --git a/src/main/xml_reader.ts b/src/main/xml_reader.ts index d1032d6..3e4cd03 100644 --- a/src/main/xml_reader.ts +++ b/src/main/xml_reader.ts @@ -18,23 +18,19 @@ * @fileoverview Validates and reads an XML file. */ -import * as fs from "node:fs"; - const XML_FILE_EXTENSION = ".xml"; -const ENCODING = "utf8"; /** * Error messages for the XmlReader class. */ export const ERROR_MESSAGES = { - invalidFilePath: (filePath: string) => - `File path ${filePath} does not exist.`, + invalidFilePath: (filePath: string) => `filePath does not exist: ${filePath}`, invalidFileExtension: (filePath: string) => - `File path ${filePath} is not an XML file.`, + `filePath must have extension ${XML_FILE_EXTENSION}: ${filePath}`, }; /** - * Reads the XML file and returns the file body. + * Validates and reads an XML file. */ export class XmlReader { constructor(private readonly filePath: string) {} @@ -42,11 +38,13 @@ export class XmlReader { getXmlFileBody(): string { this.validateFilePath(); this.validateFileExtension(); - return fs.readFileSync(this.filePath, ENCODING); + return Deno.readTextFileSync(this.filePath); } private validateFilePath() { - if (!fs.existsSync(this.filePath)) { + try { + Deno.statSync(this.filePath); + } catch { throw new Error(ERROR_MESSAGES.invalidFilePath(this.filePath)); } } diff --git a/src/test/argument_processor_test.ts b/src/test/argument_processor_test.ts index eefc042..8ef4f95 100644 --- a/src/test/argument_processor_test.ts +++ b/src/test/argument_processor_test.ts @@ -87,6 +87,9 @@ Deno.test("ArgumentProcessor", async (t) => { () => { const { argumentProcessor, config } = setupTest((config) => { config.mode = Mode.GITHUB_ACTION; + config.diagramTool = DiagramTool.MERMAID; + config.gitDiffFromHash = "HEAD^1"; + config.gitDiffToHash = "HEAD"; config.outputDirectory = undefined; config.outputFileName = undefined; }); @@ -276,3 +279,79 @@ Deno.test("ArgumentProcessor", async (t) => { }, ); }); + +Deno.test("GitHub Action mode validation", () => { + // Test valid GitHub Action configuration + const validConfig = setupTest((config) => { + config.mode = Mode.GITHUB_ACTION; + config.diagramTool = DiagramTool.MERMAID; + config.gitDiffFromHash = "HEAD^1"; + config.gitDiffToHash = "HEAD"; + }); + validConfig.argumentProcessor.getConfig(); + assertEquals(validConfig.argumentProcessor.getErrors(), []); + + // Test invalid diagram tool + const invalidDiagramTool = setupTest((config) => { + config.mode = Mode.GITHUB_ACTION; + config.diagramTool = DiagramTool.PLANTUML; + config.gitDiffFromHash = "HEAD^1"; + config.gitDiffToHash = "HEAD"; + }); + try { + invalidDiagramTool.argumentProcessor.getConfig(); + } catch {} + assertEquals( + invalidDiagramTool.argumentProcessor.getErrors(), + [ERROR_MESSAGES.githubActionRequiresMermaid], + ); + + // Test invalid git diff to hash + const invalidToHash = setupTest((config) => { + config.mode = Mode.GITHUB_ACTION; + config.diagramTool = DiagramTool.MERMAID; + config.gitDiffFromHash = "HEAD^1"; + config.gitDiffToHash = "HEAD~1"; + }); + try { + invalidToHash.argumentProcessor.getConfig(); + } catch {} + assertEquals( + invalidToHash.argumentProcessor.getErrors(), + [ERROR_MESSAGES.githubActionRequiresHeadHash], + ); + + // Test invalid git diff from hash + const invalidFromHash = setupTest((config) => { + config.mode = Mode.GITHUB_ACTION; + config.diagramTool = DiagramTool.MERMAID; + config.gitDiffFromHash = "HEAD~2"; + config.gitDiffToHash = "HEAD"; + }); + try { + invalidFromHash.argumentProcessor.getConfig(); + } catch {} + assertEquals( + invalidFromHash.argumentProcessor.getErrors(), + [ERROR_MESSAGES.githubActionRequiresHeadMinusOne], + ); + + // Test multiple invalid configurations + const multipleInvalid = setupTest((config) => { + config.mode = Mode.GITHUB_ACTION; + config.diagramTool = DiagramTool.PLANTUML; + config.gitDiffFromHash = "HEAD~2"; + config.gitDiffToHash = "HEAD~1"; + }); + try { + multipleInvalid.argumentProcessor.getConfig(); + } catch {} + assertEquals( + multipleInvalid.argumentProcessor.getErrors(), + [ + ERROR_MESSAGES.githubActionRequiresMermaid, + ERROR_MESSAGES.githubActionRequiresHeadHash, + ERROR_MESSAGES.githubActionRequiresHeadMinusOne, + ], + ); +}); diff --git a/src/test/uml_writer_test.ts b/src/test/uml_writer_test.ts index 0da1243..93609b9 100644 --- a/src/test/uml_writer_test.ts +++ b/src/test/uml_writer_test.ts @@ -16,8 +16,8 @@ import { assertEquals, assertExists } from "@std/assert"; import { assertSpyCalls, spy } from "@std/testing/mock"; -import * as fs from "node:fs"; -import * as path from "node:path"; +import { join } from "@std/path"; +import { existsSync } from "@std/fs"; import { Configuration, DiagramTool, @@ -63,7 +63,7 @@ const EXPECTED_DEFAULT_FORMAT = [ }, ]; -const expectedFilePath = path.join( +const expectedFilePath = join( TEST_UNDECLARED_OUTPUTS_DIR, `${OUTPUT_FILE_NAME}.json`, ); @@ -80,6 +80,24 @@ function getRuntimeConfig( }; } +function assertFileContents(expectedFilePath: string, actualFilePath: string) { + let fileContent: string; + try { + fileContent = Deno.readTextFileSync(expectedFilePath); + } catch { + throw new Error(`Expected file not found: ${expectedFilePath}`); + } + + let actualContent: string; + try { + actualContent = Deno.readTextFileSync(actualFilePath); + } catch { + throw new Error(`Actual file not found: ${actualFilePath}`); + } + + assertEquals(JSON.parse(actualContent), JSON.parse(fileContent)); +} + Deno.test("UmlWriter", async (t) => { let writer: UmlWriter; let fileContent: string; @@ -90,8 +108,8 @@ Deno.test("UmlWriter", async (t) => { writer.writeUmlDiagrams(); - assertExists(fs.existsSync(expectedFilePath)); - fileContent = fs.readFileSync(expectedFilePath, ENCODING).toString(); + assertExists(existsSync(expectedFilePath)); + fileContent = Deno.readTextFileSync(expectedFilePath); assertEquals(fileContent, JSON.stringify(EXPECTED_DEFAULT_FORMAT, null, 2)); await Deno.remove(expectedFilePath); From 18714603a538c554912f738c44564c38c45a9db9 Mon Sep 17 00:00:00 2001 From: Mitchell spano Date: Sat, 26 Apr 2025 20:18:24 -0500 Subject: [PATCH 2/7] Refactor Deno configuration and enhance argument processing tests - Remove unnecessary compiler options from deno.json for cleaner configuration. - Update test command in deno.json to include additional permissions for improved testing capabilities. - Refactor argument processing tests in argument_processor_test.ts for better readability and consistency, ensuring proper error handling for various configurations. --- deno.json | 16 +-- src/test/argument_processor_test.ts | 202 ++++++++++++++-------------- 2 files changed, 100 insertions(+), 118 deletions(-) diff --git a/deno.json b/deno.json index ba716c2..acff6d8 100644 --- a/deno.json +++ b/deno.json @@ -16,21 +16,7 @@ "xml2js": "npm:xml2js@^0.6.2", "yargs": "npm:yargs@^17.7.2" }, - "compilerOptions": { - "allowJs": true, - "lib": ["deno.window"], - "strict": true, - "types": ["deno"] - }, "tasks": { - "test": "deno test --allow-read --allow-env" - }, - "fmt": { - "lineWidth": 80, - "indentWidth": 2, - "useTabs": false, - "semiColons": true, - "singleQuote": false, - "proseWrap": "preserve" + "test": "deno test --allow-read --allow-env --allow-write --allow-run" } } diff --git a/src/test/argument_processor_test.ts b/src/test/argument_processor_test.ts index 8ef4f95..9657926 100644 --- a/src/test/argument_processor_test.ts +++ b/src/test/argument_processor_test.ts @@ -31,7 +31,7 @@ const INVALID_OUTPUT_DIRECTORY = "invalid/directory/path"; const INVALID_MODE = "unsupported"; function setupTest( - configModifications: (config: RuntimeConfig) => void = () => {}, + configModifications: (config: RuntimeConfig) => void = () => {} ) { let testConfiguration = getTestConfig(); configModifications(testConfiguration); @@ -54,16 +54,15 @@ Deno.test("ArgumentProcessor", async (t) => { assertThrows( () => { const { argumentProcessor } = setupTest( - ( - config, - ) => (config.diagramTool = INVALID_DIAGRAM_TOOL as DiagramTool), + (config) => + (config.diagramTool = INVALID_DIAGRAM_TOOL as DiagramTool) ); argumentProcessor.getConfig(); }, Error, - ERROR_MESSAGES.unsupportedDiagramTool(INVALID_DIAGRAM_TOOL), + ERROR_MESSAGES.unsupportedDiagramTool(INVALID_DIAGRAM_TOOL) ); - }, + } ); await t.step( @@ -72,14 +71,14 @@ Deno.test("ArgumentProcessor", async (t) => { assertThrows( () => { const { argumentProcessor } = setupTest( - (config) => (config.mode = INVALID_MODE as Mode), + (config) => (config.mode = INVALID_MODE as Mode) ); argumentProcessor.getConfig(); }, Error, - ERROR_MESSAGES.unsupportedMode(INVALID_MODE), + ERROR_MESSAGES.unsupportedMode(INVALID_MODE) ); - }, + } ); await t.step( @@ -95,7 +94,7 @@ Deno.test("ArgumentProcessor", async (t) => { }); const result = argumentProcessor.getConfig(); assertEquals(result, config); - }, + } ); await t.step( @@ -110,9 +109,9 @@ Deno.test("ArgumentProcessor", async (t) => { argumentProcessor.getConfig(); }, Error, - ERROR_MESSAGES.outputDirectoryRequired, + ERROR_MESSAGES.outputDirectoryRequired ); - }, + } ); await t.step( @@ -127,9 +126,9 @@ Deno.test("ArgumentProcessor", async (t) => { argumentProcessor.getConfig(); }, Error, - ERROR_MESSAGES.outputFileNameRequired, + ERROR_MESSAGES.outputFileNameRequired ); - }, + } ); await t.step( @@ -145,9 +144,9 @@ Deno.test("ArgumentProcessor", async (t) => { argumentProcessor.getConfig(); }, Error, - ERROR_MESSAGES.filePathDoesNotExist(INVALID_FILE_PATH), + ERROR_MESSAGES.filePathDoesNotExist(INVALID_FILE_PATH) ); - }, + } ); await t.step( @@ -156,14 +155,14 @@ Deno.test("ArgumentProcessor", async (t) => { assertThrows( () => { const { argumentProcessor } = setupTest( - (config) => (config.outputFileName = ""), + (config) => (config.outputFileName = "") ); argumentProcessor.getConfig(); }, Error, - ERROR_MESSAGES.outputFileNameRequired, + ERROR_MESSAGES.outputFileNameRequired ); - }, + } ); await t.step( @@ -172,14 +171,14 @@ Deno.test("ArgumentProcessor", async (t) => { assertThrows( () => { const { argumentProcessor } = setupTest( - (config) => (config.outputFileName = INVALID_OUTPUT_FILE_NAME), + (config) => (config.outputFileName = INVALID_OUTPUT_FILE_NAME) ); argumentProcessor.getConfig(); }, Error, - ERROR_MESSAGES.invalidOutputFileName(INVALID_OUTPUT_FILE_NAME), + ERROR_MESSAGES.invalidOutputFileName(INVALID_OUTPUT_FILE_NAME) ); - }, + } ); await t.step( @@ -188,14 +187,14 @@ Deno.test("ArgumentProcessor", async (t) => { assertThrows( () => { const { argumentProcessor } = setupTest( - (config) => (config.outputDirectory = INVALID_OUTPUT_DIRECTORY), + (config) => (config.outputDirectory = INVALID_OUTPUT_DIRECTORY) ); argumentProcessor.getConfig(); }, Error, - ERROR_MESSAGES.invalidOutputDirectory(INVALID_OUTPUT_DIRECTORY), + ERROR_MESSAGES.invalidOutputDirectory(INVALID_OUTPUT_DIRECTORY) ); - }, + } ); await t.step( @@ -204,14 +203,14 @@ Deno.test("ArgumentProcessor", async (t) => { assertThrows( () => { const { argumentProcessor } = setupTest( - (config) => (config.outputDirectory = ""), + (config) => (config.outputDirectory = "") ); argumentProcessor.getConfig(); }, Error, - ERROR_MESSAGES.outputDirectoryRequired, + ERROR_MESSAGES.outputDirectoryRequired ); - }, + } ); await t.step( @@ -226,9 +225,9 @@ Deno.test("ArgumentProcessor", async (t) => { argumentProcessor.getConfig(); }, Error, - ERROR_MESSAGES.filePathOrGitDiffFromAndToHashRequired, + ERROR_MESSAGES.filePathOrGitDiffFromAndToHashRequired ); - }, + } ); await t.step( @@ -237,14 +236,14 @@ Deno.test("ArgumentProcessor", async (t) => { assertThrows( () => { const { argumentProcessor } = setupTest( - (config) => (config.filePath = [INVALID_FILE_PATH]), + (config) => (config.filePath = [INVALID_FILE_PATH]) ); argumentProcessor.getConfig(); }, Error, - ERROR_MESSAGES.filePathAndGitDiffFromAndToHashMutuallyExclusive, + ERROR_MESSAGES.filePathAndGitDiffFromAndToHashMutuallyExclusive ); - }, + } ); await t.step( @@ -253,14 +252,14 @@ Deno.test("ArgumentProcessor", async (t) => { assertThrows( () => { const { argumentProcessor } = setupTest( - (config) => (config.gitDiffToHash = undefined), + (config) => (config.gitDiffToHash = undefined) ); argumentProcessor.getConfig(); }, Error, - ERROR_MESSAGES.gitDiffFromAndToHashMustBeSpecifiedTogether, + ERROR_MESSAGES.gitDiffFromAndToHashMustBeSpecifiedTogether ); - }, + } ); await t.step( @@ -269,89 +268,86 @@ Deno.test("ArgumentProcessor", async (t) => { assertThrows( () => { const { argumentProcessor } = setupTest( - (config) => (config.gitDiffFromHash = undefined), + (config) => (config.gitDiffFromHash = undefined) ); argumentProcessor.getConfig(); }, Error, - ERROR_MESSAGES.gitDiffFromAndToHashMustBeSpecifiedTogether, + ERROR_MESSAGES.gitDiffFromAndToHashMustBeSpecifiedTogether ); - }, + } ); -}); -Deno.test("GitHub Action mode validation", () => { - // Test valid GitHub Action configuration - const validConfig = setupTest((config) => { - config.mode = Mode.GITHUB_ACTION; - config.diagramTool = DiagramTool.MERMAID; - config.gitDiffFromHash = "HEAD^1"; - config.gitDiffToHash = "HEAD"; + await t.step("GitHub Action mode - valid configuration", () => { + const validConfig = setupTest((config) => { + config.mode = Mode.GITHUB_ACTION; + config.diagramTool = DiagramTool.MERMAID; + config.gitDiffFromHash = "HEAD^1"; + config.gitDiffToHash = "HEAD"; + }); + validConfig.argumentProcessor.getConfig(); + assertEquals(validConfig.argumentProcessor.getErrors(), []); }); - validConfig.argumentProcessor.getConfig(); - assertEquals(validConfig.argumentProcessor.getErrors(), []); - // Test invalid diagram tool - const invalidDiagramTool = setupTest((config) => { - config.mode = Mode.GITHUB_ACTION; - config.diagramTool = DiagramTool.PLANTUML; - config.gitDiffFromHash = "HEAD^1"; - config.gitDiffToHash = "HEAD"; + await t.step("GitHub Action mode - invalid diagram tool", () => { + const invalidDiagramTool = setupTest((config) => { + config.mode = Mode.GITHUB_ACTION; + config.diagramTool = DiagramTool.PLANTUML; + config.gitDiffFromHash = "HEAD^1"; + config.gitDiffToHash = "HEAD"; + }); + try { + invalidDiagramTool.argumentProcessor.getConfig(); + } catch {} + assertEquals(invalidDiagramTool.argumentProcessor.getErrors(), [ + ERROR_MESSAGES.githubActionRequiresMermaid, + ]); }); - try { - invalidDiagramTool.argumentProcessor.getConfig(); - } catch {} - assertEquals( - invalidDiagramTool.argumentProcessor.getErrors(), - [ERROR_MESSAGES.githubActionRequiresMermaid], - ); - // Test invalid git diff to hash - const invalidToHash = setupTest((config) => { - config.mode = Mode.GITHUB_ACTION; - config.diagramTool = DiagramTool.MERMAID; - config.gitDiffFromHash = "HEAD^1"; - config.gitDiffToHash = "HEAD~1"; + await t.step("GitHub Action mode - invalid git diff to hash", () => { + const invalidToHash = setupTest((config) => { + config.mode = Mode.GITHUB_ACTION; + config.diagramTool = DiagramTool.MERMAID; + config.gitDiffFromHash = "HEAD^1"; + config.gitDiffToHash = "HEAD~1"; + }); + try { + invalidToHash.argumentProcessor.getConfig(); + } catch {} + assertEquals(invalidToHash.argumentProcessor.getErrors(), [ + ERROR_MESSAGES.githubActionRequiresHeadHash, + ]); }); - try { - invalidToHash.argumentProcessor.getConfig(); - } catch {} - assertEquals( - invalidToHash.argumentProcessor.getErrors(), - [ERROR_MESSAGES.githubActionRequiresHeadHash], - ); - // Test invalid git diff from hash - const invalidFromHash = setupTest((config) => { - config.mode = Mode.GITHUB_ACTION; - config.diagramTool = DiagramTool.MERMAID; - config.gitDiffFromHash = "HEAD~2"; - config.gitDiffToHash = "HEAD"; + await t.step("GitHub Action mode - invalid git diff from hash", () => { + const invalidFromHash = setupTest((config) => { + config.mode = Mode.GITHUB_ACTION; + config.diagramTool = DiagramTool.MERMAID; + config.gitDiffFromHash = "HEAD~2"; + config.gitDiffToHash = "HEAD"; + }); + try { + invalidFromHash.argumentProcessor.getConfig(); + } catch {} + assertEquals(invalidFromHash.argumentProcessor.getErrors(), [ + ERROR_MESSAGES.githubActionRequiresHeadMinusOne, + ]); }); - try { - invalidFromHash.argumentProcessor.getConfig(); - } catch {} - assertEquals( - invalidFromHash.argumentProcessor.getErrors(), - [ERROR_MESSAGES.githubActionRequiresHeadMinusOne], - ); - // Test multiple invalid configurations - const multipleInvalid = setupTest((config) => { - config.mode = Mode.GITHUB_ACTION; - config.diagramTool = DiagramTool.PLANTUML; - config.gitDiffFromHash = "HEAD~2"; - config.gitDiffToHash = "HEAD~1"; - }); - try { - multipleInvalid.argumentProcessor.getConfig(); - } catch {} - assertEquals( - multipleInvalid.argumentProcessor.getErrors(), - [ + await t.step("GitHub Action mode - multiple invalid configurations", () => { + const multipleInvalid = setupTest((config) => { + config.mode = Mode.GITHUB_ACTION; + config.diagramTool = DiagramTool.PLANTUML; + config.gitDiffFromHash = "HEAD~2"; + config.gitDiffToHash = "HEAD~1"; + }); + try { + multipleInvalid.argumentProcessor.getConfig(); + } catch {} + assertEquals(multipleInvalid.argumentProcessor.getErrors(), [ ERROR_MESSAGES.githubActionRequiresMermaid, ERROR_MESSAGES.githubActionRequiresHeadHash, ERROR_MESSAGES.githubActionRequiresHeadMinusOne, - ], - ); + ]); + }); }); From 76b7baf53ed795f23ecc47d1d329def4f8e2f304 Mon Sep 17 00:00:00 2001 From: Mitchell spano Date: Sat, 26 Apr 2025 20:24:45 -0500 Subject: [PATCH 3/7] Refactor argument processing tests for GitHub Action mode validation - Update test descriptions for clarity and consistency, ensuring they follow a standardized format. - Enhance tests to validate valid and invalid configurations for GitHub Action mode, including checks for diagram tool and git diff hashes. - Improve error handling assertions to ensure accurate feedback for multiple invalid configurations. --- src/test/argument_processor_test.ts | 151 +++++++++++++++------------- 1 file changed, 83 insertions(+), 68 deletions(-) diff --git a/src/test/argument_processor_test.ts b/src/test/argument_processor_test.ts index 9657926..404a372 100644 --- a/src/test/argument_processor_test.ts +++ b/src/test/argument_processor_test.ts @@ -278,76 +278,91 @@ Deno.test("ArgumentProcessor", async (t) => { } ); - await t.step("GitHub Action mode - valid configuration", () => { - const validConfig = setupTest((config) => { - config.mode = Mode.GITHUB_ACTION; - config.diagramTool = DiagramTool.MERMAID; - config.gitDiffFromHash = "HEAD^1"; - config.gitDiffToHash = "HEAD"; - }); - validConfig.argumentProcessor.getConfig(); - assertEquals(validConfig.argumentProcessor.getErrors(), []); - }); + await t.step( + "should validate GitHub Action mode with valid configuration", + () => { + const validConfig = setupTest((config) => { + config.mode = Mode.GITHUB_ACTION; + config.diagramTool = DiagramTool.MERMAID; + config.gitDiffFromHash = "HEAD^1"; + config.gitDiffToHash = "HEAD"; + }); + validConfig.argumentProcessor.getConfig(); + assertEquals(validConfig.argumentProcessor.getErrors(), []); + } + ); - await t.step("GitHub Action mode - invalid diagram tool", () => { - const invalidDiagramTool = setupTest((config) => { - config.mode = Mode.GITHUB_ACTION; - config.diagramTool = DiagramTool.PLANTUML; - config.gitDiffFromHash = "HEAD^1"; - config.gitDiffToHash = "HEAD"; - }); - try { - invalidDiagramTool.argumentProcessor.getConfig(); - } catch {} - assertEquals(invalidDiagramTool.argumentProcessor.getErrors(), [ - ERROR_MESSAGES.githubActionRequiresMermaid, - ]); - }); + await t.step( + "should reject GitHub Action mode with invalid diagram tool", + () => { + const invalidDiagramTool = setupTest((config) => { + config.mode = Mode.GITHUB_ACTION; + config.diagramTool = DiagramTool.PLANTUML; + config.gitDiffFromHash = "HEAD^1"; + config.gitDiffToHash = "HEAD"; + }); + try { + invalidDiagramTool.argumentProcessor.getConfig(); + } catch {} + assertEquals(invalidDiagramTool.argumentProcessor.getErrors(), [ + ERROR_MESSAGES.githubActionRequiresMermaid, + ]); + } + ); - await t.step("GitHub Action mode - invalid git diff to hash", () => { - const invalidToHash = setupTest((config) => { - config.mode = Mode.GITHUB_ACTION; - config.diagramTool = DiagramTool.MERMAID; - config.gitDiffFromHash = "HEAD^1"; - config.gitDiffToHash = "HEAD~1"; - }); - try { - invalidToHash.argumentProcessor.getConfig(); - } catch {} - assertEquals(invalidToHash.argumentProcessor.getErrors(), [ - ERROR_MESSAGES.githubActionRequiresHeadHash, - ]); - }); + await t.step( + "should reject GitHub Action mode with invalid git diff to hash", + () => { + const invalidToHash = setupTest((config) => { + config.mode = Mode.GITHUB_ACTION; + config.diagramTool = DiagramTool.MERMAID; + config.gitDiffFromHash = "HEAD^1"; + config.gitDiffToHash = "HEAD~1"; + }); + try { + invalidToHash.argumentProcessor.getConfig(); + } catch {} + assertEquals(invalidToHash.argumentProcessor.getErrors(), [ + ERROR_MESSAGES.githubActionRequiresHeadHash, + ]); + } + ); - await t.step("GitHub Action mode - invalid git diff from hash", () => { - const invalidFromHash = setupTest((config) => { - config.mode = Mode.GITHUB_ACTION; - config.diagramTool = DiagramTool.MERMAID; - config.gitDiffFromHash = "HEAD~2"; - config.gitDiffToHash = "HEAD"; - }); - try { - invalidFromHash.argumentProcessor.getConfig(); - } catch {} - assertEquals(invalidFromHash.argumentProcessor.getErrors(), [ - ERROR_MESSAGES.githubActionRequiresHeadMinusOne, - ]); - }); + await t.step( + "should reject GitHub Action mode with invalid git diff from hash", + () => { + const invalidFromHash = setupTest((config) => { + config.mode = Mode.GITHUB_ACTION; + config.diagramTool = DiagramTool.MERMAID; + config.gitDiffFromHash = "HEAD~2"; + config.gitDiffToHash = "HEAD"; + }); + try { + invalidFromHash.argumentProcessor.getConfig(); + } catch {} + assertEquals(invalidFromHash.argumentProcessor.getErrors(), [ + ERROR_MESSAGES.githubActionRequiresHeadMinusOne, + ]); + } + ); - await t.step("GitHub Action mode - multiple invalid configurations", () => { - const multipleInvalid = setupTest((config) => { - config.mode = Mode.GITHUB_ACTION; - config.diagramTool = DiagramTool.PLANTUML; - config.gitDiffFromHash = "HEAD~2"; - config.gitDiffToHash = "HEAD~1"; - }); - try { - multipleInvalid.argumentProcessor.getConfig(); - } catch {} - assertEquals(multipleInvalid.argumentProcessor.getErrors(), [ - ERROR_MESSAGES.githubActionRequiresMermaid, - ERROR_MESSAGES.githubActionRequiresHeadHash, - ERROR_MESSAGES.githubActionRequiresHeadMinusOne, - ]); - }); + await t.step( + "should reject GitHub Action mode with multiple invalid configurations", + () => { + const multipleInvalid = setupTest((config) => { + config.mode = Mode.GITHUB_ACTION; + config.diagramTool = DiagramTool.PLANTUML; + config.gitDiffFromHash = "HEAD~2"; + config.gitDiffToHash = "HEAD~1"; + }); + try { + multipleInvalid.argumentProcessor.getConfig(); + } catch {} + assertEquals(multipleInvalid.argumentProcessor.getErrors(), [ + ERROR_MESSAGES.githubActionRequiresMermaid, + ERROR_MESSAGES.githubActionRequiresHeadHash, + ERROR_MESSAGES.githubActionRequiresHeadMinusOne, + ]); + } + ); }); From c027aebfb4b6f9ad916ecf6fbc07273148bcddd4 Mon Sep 17 00:00:00 2001 From: Mitchell spano Date: Sat, 26 Apr 2025 20:27:46 -0500 Subject: [PATCH 4/7] Remove unused function in uml_writer_test --- src/test/uml_writer_test.ts | 30 ++++++------------------------ 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/src/test/uml_writer_test.ts b/src/test/uml_writer_test.ts index 93609b9..2b73994 100644 --- a/src/test/uml_writer_test.ts +++ b/src/test/uml_writer_test.ts @@ -65,12 +65,12 @@ const EXPECTED_DEFAULT_FORMAT = [ const expectedFilePath = join( TEST_UNDECLARED_OUTPUTS_DIR, - `${OUTPUT_FILE_NAME}.json`, + `${OUTPUT_FILE_NAME}.json` ); function getRuntimeConfig( diagramTool: DiagramTool = DiagramTool.PLANTUML, - mode: Mode = Mode.JSON, + mode: Mode = Mode.JSON ): RuntimeConfig { return { diagramTool, @@ -80,24 +80,6 @@ function getRuntimeConfig( }; } -function assertFileContents(expectedFilePath: string, actualFilePath: string) { - let fileContent: string; - try { - fileContent = Deno.readTextFileSync(expectedFilePath); - } catch { - throw new Error(`Expected file not found: ${expectedFilePath}`); - } - - let actualContent: string; - try { - actualContent = Deno.readTextFileSync(actualFilePath); - } catch { - throw new Error(`Actual file not found: ${actualFilePath}`); - } - - assertEquals(JSON.parse(actualContent), JSON.parse(fileContent)); -} - Deno.test("UmlWriter", async (t) => { let writer: UmlWriter; let fileContent: string; @@ -128,7 +110,7 @@ Deno.test("UmlWriter", async (t) => { path: filePath, subject_type: "file", body: _body, - }), + }) ), // Add the new methods getAllCommentsForPullRequest: spy(async () => { @@ -155,7 +137,7 @@ Deno.test("UmlWriter", async (t) => { writer = new UmlWriter( FILE_PATH_TO_FLOW_DIFFERENCE, - mockGithubClient as unknown as GithubClient, + mockGithubClient as unknown as GithubClient ); await writer.writeUmlDiagrams(); // Make this await the async operation @@ -169,11 +151,11 @@ Deno.test("UmlWriter", async (t) => { // Verify that the methods were called the expected number of times assertSpyCalls( mockGithubClient.translateToComment, - FILE_PATH_TO_FLOW_DIFFERENCE.size, + FILE_PATH_TO_FLOW_DIFFERENCE.size ); assertSpyCalls( mockGithubClient.writeComment, - FILE_PATH_TO_FLOW_DIFFERENCE.size, + FILE_PATH_TO_FLOW_DIFFERENCE.size ); // Verify the content of the calls From b81ea720f3657ba440da66adbf1ecaa92189cf23 Mon Sep 17 00:00:00 2001 From: Mitchell spano Date: Sat, 26 Apr 2025 20:42:44 -0500 Subject: [PATCH 5/7] Remove unused dependencies from Deno configuration - Eliminate jasmine and yargs from deno.json and deno.lock as they are no longer needed, streamlining the project dependencies. --- deno.json | 4 +- deno.lock | 239 +----------------------------------------------------- 2 files changed, 5 insertions(+), 238 deletions(-) diff --git a/deno.json b/deno.json index acff6d8..69309e2 100644 --- a/deno.json +++ b/deno.json @@ -12,9 +12,7 @@ "@std/path": "jsr:@std/path@^1.0.9", "@std/testing": "jsr:@std/testing@^1.0.11", "@types/node": "npm:@types/node@^22.10.2", - "jasmine": "npm:jasmine@^5.5.0", - "xml2js": "npm:xml2js@^0.6.2", - "yargs": "npm:yargs@^17.7.2" + "xml2js": "npm:xml2js@^0.6.2" }, "tasks": { "test": "deno test --allow-read --allow-env --allow-write --allow-run" diff --git a/deno.lock b/deno.lock index 67435a7..61fccfd 100644 --- a/deno.lock +++ b/deno.lock @@ -17,9 +17,7 @@ "npm:@octokit/core@^6.1.4": "6.1.4", "npm:@types/node@*": "22.5.4", "npm:@types/node@^22.10.2": "22.10.2", - "npm:jasmine@^5.5.0": "5.5.0", - "npm:xml2js@~0.6.2": "0.6.2", - "npm:yargs@^17.7.2": "17.7.2" + "npm:xml2js@~0.6.2": "0.6.2" }, "jsr": { "@std/assert@1.0.13": { @@ -77,17 +75,6 @@ "@fastify/busboy@2.1.1": { "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==" }, - "@isaacs/cliui@8.0.2": { - "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", - "dependencies": [ - "string-width-cjs@npm:string-width@4.2.3", - "string-width@5.1.2", - "strip-ansi-cjs@npm:strip-ansi@6.0.1", - "strip-ansi@7.1.0", - "wrap-ansi-cjs@npm:wrap-ansi@7.0.0", - "wrap-ansi@8.1.0" - ] - }, "@octokit/auth-token@4.0.0": { "integrity": "sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==" }, @@ -99,8 +86,8 @@ "dependencies": [ "@octokit/auth-token@4.0.0", "@octokit/graphql@7.1.1", - "@octokit/request-error@5.1.1", "@octokit/request@8.4.1", + "@octokit/request-error@5.1.1", "@octokit/types@13.8.0", "before-after-hook@2.2.3", "universal-user-agent@6.0.1" @@ -111,8 +98,8 @@ "dependencies": [ "@octokit/auth-token@5.1.2", "@octokit/graphql@8.2.1", - "@octokit/request-error@6.1.7", "@octokit/request@9.2.2", + "@octokit/request-error@6.1.7", "@octokit/types@13.8.0", "before-after-hook@3.0.2", "universal-user-agent@7.0.2" @@ -213,9 +200,6 @@ "@octokit/openapi-types@23.0.1" ] }, - "@pkgjs/parseargs@0.11.0": { - "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==" - }, "@types/node@22.10.2": { "integrity": "sha512-Xxr6BBRCAOQixvonOye19wnzyDiUtTeqldOOmj3CkeblonbccA12PFwlufvRdrpjXxqnmUaeiU5EOA+7s5diUQ==", "dependencies": [ @@ -228,200 +212,27 @@ "undici-types@6.19.8" ] }, - "ansi-regex@5.0.1": { - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" - }, - "ansi-regex@6.1.0": { - "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==" - }, - "ansi-styles@4.3.0": { - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dependencies": [ - "color-convert" - ] - }, - "ansi-styles@6.2.1": { - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==" - }, - "balanced-match@1.0.2": { - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" - }, "before-after-hook@2.2.3": { "integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==" }, "before-after-hook@3.0.2": { "integrity": "sha512-Nik3Sc0ncrMK4UUdXQmAnRtzmNQTAAXmXIopizwZ1W1t8QmfJj+zL4OA2I7XPTPW5z5TDqv4hRo/JzouDJnX3A==" }, - "brace-expansion@2.0.1": { - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dependencies": [ - "balanced-match" - ] - }, - "cliui@8.0.1": { - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "dependencies": [ - "string-width@4.2.3", - "strip-ansi@6.0.1", - "wrap-ansi@7.0.0" - ] - }, - "color-convert@2.0.1": { - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dependencies": [ - "color-name" - ] - }, - "color-name@1.1.4": { - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "cross-spawn@7.0.3": { - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dependencies": [ - "path-key", - "shebang-command", - "which" - ] - }, "deprecation@2.3.1": { "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==" }, - "eastasianwidth@0.2.0": { - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" - }, - "emoji-regex@8.0.0": { - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" - }, - "emoji-regex@9.2.2": { - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" - }, - "escalade@3.2.0": { - "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==" - }, "fast-content-type-parse@2.0.1": { "integrity": "sha512-nGqtvLrj5w0naR6tDPfB4cUmYCqouzyQiz6C5y/LtcDllJdrcc6WaWW6iXyIIOErTa/XRybj28aasdn4LkVk6Q==" }, - "foreground-child@3.3.0": { - "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==", - "dependencies": [ - "cross-spawn", - "signal-exit" - ] - }, - "get-caller-file@2.0.5": { - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" - }, - "glob@10.4.5": { - "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", - "dependencies": [ - "foreground-child", - "jackspeak", - "minimatch", - "minipass", - "package-json-from-dist", - "path-scurry" - ] - }, - "is-fullwidth-code-point@3.0.0": { - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" - }, - "isexe@2.0.0": { - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" - }, - "jackspeak@3.4.3": { - "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", - "dependencies": [ - "@isaacs/cliui", - "@pkgjs/parseargs" - ] - }, - "jasmine-core@5.5.0": { - "integrity": "sha512-NHOvoPO6o9gVR6pwqEACTEpbgcH+JJ6QDypyymGbSUIFIFsMMbBJ/xsFNud8MSClfnWclXd7RQlAZBz7yVo5TQ==" - }, - "jasmine@5.5.0": { - "integrity": "sha512-JKlEVCVD5QBPYLsg/VE+IUtjyseDCrW8rMBu8la+9ysYashDgavMLM9Kotls1FhI6dCJLJ40dBCIfQjGLPZI1Q==", - "dependencies": [ - "glob", - "jasmine-core" - ] - }, - "lru-cache@10.4.3": { - "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==" - }, - "minimatch@9.0.5": { - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "dependencies": [ - "brace-expansion" - ] - }, - "minipass@7.1.2": { - "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==" - }, "once@1.4.0": { "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "dependencies": [ "wrappy" ] }, - "package-json-from-dist@1.0.1": { - "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==" - }, - "path-key@3.1.1": { - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" - }, - "path-scurry@1.11.1": { - "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", - "dependencies": [ - "lru-cache", - "minipass" - ] - }, - "require-directory@2.1.1": { - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==" - }, "sax@1.4.1": { "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==" }, - "shebang-command@2.0.0": { - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dependencies": [ - "shebang-regex" - ] - }, - "shebang-regex@3.0.0": { - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" - }, - "signal-exit@4.1.0": { - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==" - }, - "string-width@4.2.3": { - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dependencies": [ - "emoji-regex@8.0.0", - "is-fullwidth-code-point", - "strip-ansi@6.0.1" - ] - }, - "string-width@5.1.2": { - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dependencies": [ - "eastasianwidth", - "emoji-regex@9.2.2", - "strip-ansi@7.1.0" - ] - }, - "strip-ansi@6.0.1": { - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dependencies": [ - "ansi-regex@5.0.1" - ] - }, - "strip-ansi@7.1.0": { - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dependencies": [ - "ansi-regex@6.1.0" - ] - }, "tunnel@0.0.6": { "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==" }, @@ -443,28 +254,6 @@ "universal-user-agent@7.0.2": { "integrity": "sha512-0JCqzSKnStlRRQfCdowvqy3cy0Dvtlb8xecj/H8JFZuCze4rwjPZQOgvFvn0Ws/usCHQFGpyr+pB9adaGwXn4Q==" }, - "which@2.0.2": { - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dependencies": [ - "isexe" - ] - }, - "wrap-ansi@7.0.0": { - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dependencies": [ - "ansi-styles@4.3.0", - "string-width@4.2.3", - "strip-ansi@6.0.1" - ] - }, - "wrap-ansi@8.1.0": { - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "dependencies": [ - "ansi-styles@6.2.1", - "string-width@5.1.2", - "strip-ansi@7.1.0" - ] - }, "wrappy@1.0.2": { "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, @@ -477,24 +266,6 @@ }, "xmlbuilder@11.0.1": { "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==" - }, - "y18n@5.0.8": { - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==" - }, - "yargs-parser@21.1.1": { - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==" - }, - "yargs@17.7.2": { - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", - "dependencies": [ - "cliui", - "escalade", - "get-caller-file", - "require-directory", - "string-width@4.2.3", - "y18n", - "yargs-parser" - ] } }, "remote": { @@ -793,9 +564,7 @@ "npm:@actions/github@6", "npm:@octokit/core@^6.1.4", "npm:@types/node@^22.10.2", - "npm:jasmine@^5.5.0", - "npm:xml2js@~0.6.2", - "npm:yargs@^17.7.2" + "npm:xml2js@~0.6.2" ] } } From e816936710e834319d3b101527eb907d4df6d95a Mon Sep 17 00:00:00 2001 From: Mitchell spano Date: Sat, 26 Apr 2025 20:49:18 -0500 Subject: [PATCH 6/7] Update JSR package version number --- deno.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deno.json b/deno.json index 69309e2..1f8a53c 100644 --- a/deno.json +++ b/deno.json @@ -1,6 +1,6 @@ { "name": "@goog/flow-lens", - "version": "0.1.9", + "version": "0.1.10", "license": "Apache", "exports": "./src/main/main.ts", "imports": { From 6fbb3e5979e2a9d3d125db22997ac92695141cc3 Mon Sep 17 00:00:00 2001 From: Mitchell spano Date: Sat, 26 Apr 2025 20:50:11 -0500 Subject: [PATCH 7/7] Format using `deno fmt` --- src/test/argument_processor_test.ts | 87 +++++++++++++++-------------- src/test/uml_writer_test.ts | 12 ++-- 2 files changed, 50 insertions(+), 49 deletions(-) diff --git a/src/test/argument_processor_test.ts b/src/test/argument_processor_test.ts index 404a372..456ed29 100644 --- a/src/test/argument_processor_test.ts +++ b/src/test/argument_processor_test.ts @@ -31,7 +31,7 @@ const INVALID_OUTPUT_DIRECTORY = "invalid/directory/path"; const INVALID_MODE = "unsupported"; function setupTest( - configModifications: (config: RuntimeConfig) => void = () => {} + configModifications: (config: RuntimeConfig) => void = () => {}, ) { let testConfiguration = getTestConfig(); configModifications(testConfiguration); @@ -54,15 +54,16 @@ Deno.test("ArgumentProcessor", async (t) => { assertThrows( () => { const { argumentProcessor } = setupTest( - (config) => - (config.diagramTool = INVALID_DIAGRAM_TOOL as DiagramTool) + ( + config, + ) => (config.diagramTool = INVALID_DIAGRAM_TOOL as DiagramTool), ); argumentProcessor.getConfig(); }, Error, - ERROR_MESSAGES.unsupportedDiagramTool(INVALID_DIAGRAM_TOOL) + ERROR_MESSAGES.unsupportedDiagramTool(INVALID_DIAGRAM_TOOL), ); - } + }, ); await t.step( @@ -71,14 +72,14 @@ Deno.test("ArgumentProcessor", async (t) => { assertThrows( () => { const { argumentProcessor } = setupTest( - (config) => (config.mode = INVALID_MODE as Mode) + (config) => (config.mode = INVALID_MODE as Mode), ); argumentProcessor.getConfig(); }, Error, - ERROR_MESSAGES.unsupportedMode(INVALID_MODE) + ERROR_MESSAGES.unsupportedMode(INVALID_MODE), ); - } + }, ); await t.step( @@ -94,7 +95,7 @@ Deno.test("ArgumentProcessor", async (t) => { }); const result = argumentProcessor.getConfig(); assertEquals(result, config); - } + }, ); await t.step( @@ -109,9 +110,9 @@ Deno.test("ArgumentProcessor", async (t) => { argumentProcessor.getConfig(); }, Error, - ERROR_MESSAGES.outputDirectoryRequired + ERROR_MESSAGES.outputDirectoryRequired, ); - } + }, ); await t.step( @@ -126,9 +127,9 @@ Deno.test("ArgumentProcessor", async (t) => { argumentProcessor.getConfig(); }, Error, - ERROR_MESSAGES.outputFileNameRequired + ERROR_MESSAGES.outputFileNameRequired, ); - } + }, ); await t.step( @@ -144,9 +145,9 @@ Deno.test("ArgumentProcessor", async (t) => { argumentProcessor.getConfig(); }, Error, - ERROR_MESSAGES.filePathDoesNotExist(INVALID_FILE_PATH) + ERROR_MESSAGES.filePathDoesNotExist(INVALID_FILE_PATH), ); - } + }, ); await t.step( @@ -155,14 +156,14 @@ Deno.test("ArgumentProcessor", async (t) => { assertThrows( () => { const { argumentProcessor } = setupTest( - (config) => (config.outputFileName = "") + (config) => (config.outputFileName = ""), ); argumentProcessor.getConfig(); }, Error, - ERROR_MESSAGES.outputFileNameRequired + ERROR_MESSAGES.outputFileNameRequired, ); - } + }, ); await t.step( @@ -171,14 +172,14 @@ Deno.test("ArgumentProcessor", async (t) => { assertThrows( () => { const { argumentProcessor } = setupTest( - (config) => (config.outputFileName = INVALID_OUTPUT_FILE_NAME) + (config) => (config.outputFileName = INVALID_OUTPUT_FILE_NAME), ); argumentProcessor.getConfig(); }, Error, - ERROR_MESSAGES.invalidOutputFileName(INVALID_OUTPUT_FILE_NAME) + ERROR_MESSAGES.invalidOutputFileName(INVALID_OUTPUT_FILE_NAME), ); - } + }, ); await t.step( @@ -187,14 +188,14 @@ Deno.test("ArgumentProcessor", async (t) => { assertThrows( () => { const { argumentProcessor } = setupTest( - (config) => (config.outputDirectory = INVALID_OUTPUT_DIRECTORY) + (config) => (config.outputDirectory = INVALID_OUTPUT_DIRECTORY), ); argumentProcessor.getConfig(); }, Error, - ERROR_MESSAGES.invalidOutputDirectory(INVALID_OUTPUT_DIRECTORY) + ERROR_MESSAGES.invalidOutputDirectory(INVALID_OUTPUT_DIRECTORY), ); - } + }, ); await t.step( @@ -203,14 +204,14 @@ Deno.test("ArgumentProcessor", async (t) => { assertThrows( () => { const { argumentProcessor } = setupTest( - (config) => (config.outputDirectory = "") + (config) => (config.outputDirectory = ""), ); argumentProcessor.getConfig(); }, Error, - ERROR_MESSAGES.outputDirectoryRequired + ERROR_MESSAGES.outputDirectoryRequired, ); - } + }, ); await t.step( @@ -225,9 +226,9 @@ Deno.test("ArgumentProcessor", async (t) => { argumentProcessor.getConfig(); }, Error, - ERROR_MESSAGES.filePathOrGitDiffFromAndToHashRequired + ERROR_MESSAGES.filePathOrGitDiffFromAndToHashRequired, ); - } + }, ); await t.step( @@ -236,14 +237,14 @@ Deno.test("ArgumentProcessor", async (t) => { assertThrows( () => { const { argumentProcessor } = setupTest( - (config) => (config.filePath = [INVALID_FILE_PATH]) + (config) => (config.filePath = [INVALID_FILE_PATH]), ); argumentProcessor.getConfig(); }, Error, - ERROR_MESSAGES.filePathAndGitDiffFromAndToHashMutuallyExclusive + ERROR_MESSAGES.filePathAndGitDiffFromAndToHashMutuallyExclusive, ); - } + }, ); await t.step( @@ -252,14 +253,14 @@ Deno.test("ArgumentProcessor", async (t) => { assertThrows( () => { const { argumentProcessor } = setupTest( - (config) => (config.gitDiffToHash = undefined) + (config) => (config.gitDiffToHash = undefined), ); argumentProcessor.getConfig(); }, Error, - ERROR_MESSAGES.gitDiffFromAndToHashMustBeSpecifiedTogether + ERROR_MESSAGES.gitDiffFromAndToHashMustBeSpecifiedTogether, ); - } + }, ); await t.step( @@ -268,14 +269,14 @@ Deno.test("ArgumentProcessor", async (t) => { assertThrows( () => { const { argumentProcessor } = setupTest( - (config) => (config.gitDiffFromHash = undefined) + (config) => (config.gitDiffFromHash = undefined), ); argumentProcessor.getConfig(); }, Error, - ERROR_MESSAGES.gitDiffFromAndToHashMustBeSpecifiedTogether + ERROR_MESSAGES.gitDiffFromAndToHashMustBeSpecifiedTogether, ); - } + }, ); await t.step( @@ -289,7 +290,7 @@ Deno.test("ArgumentProcessor", async (t) => { }); validConfig.argumentProcessor.getConfig(); assertEquals(validConfig.argumentProcessor.getErrors(), []); - } + }, ); await t.step( @@ -307,7 +308,7 @@ Deno.test("ArgumentProcessor", async (t) => { assertEquals(invalidDiagramTool.argumentProcessor.getErrors(), [ ERROR_MESSAGES.githubActionRequiresMermaid, ]); - } + }, ); await t.step( @@ -325,7 +326,7 @@ Deno.test("ArgumentProcessor", async (t) => { assertEquals(invalidToHash.argumentProcessor.getErrors(), [ ERROR_MESSAGES.githubActionRequiresHeadHash, ]); - } + }, ); await t.step( @@ -343,7 +344,7 @@ Deno.test("ArgumentProcessor", async (t) => { assertEquals(invalidFromHash.argumentProcessor.getErrors(), [ ERROR_MESSAGES.githubActionRequiresHeadMinusOne, ]); - } + }, ); await t.step( @@ -363,6 +364,6 @@ Deno.test("ArgumentProcessor", async (t) => { ERROR_MESSAGES.githubActionRequiresHeadHash, ERROR_MESSAGES.githubActionRequiresHeadMinusOne, ]); - } + }, ); }); diff --git a/src/test/uml_writer_test.ts b/src/test/uml_writer_test.ts index 2b73994..963d22b 100644 --- a/src/test/uml_writer_test.ts +++ b/src/test/uml_writer_test.ts @@ -65,12 +65,12 @@ const EXPECTED_DEFAULT_FORMAT = [ const expectedFilePath = join( TEST_UNDECLARED_OUTPUTS_DIR, - `${OUTPUT_FILE_NAME}.json` + `${OUTPUT_FILE_NAME}.json`, ); function getRuntimeConfig( diagramTool: DiagramTool = DiagramTool.PLANTUML, - mode: Mode = Mode.JSON + mode: Mode = Mode.JSON, ): RuntimeConfig { return { diagramTool, @@ -110,7 +110,7 @@ Deno.test("UmlWriter", async (t) => { path: filePath, subject_type: "file", body: _body, - }) + }), ), // Add the new methods getAllCommentsForPullRequest: spy(async () => { @@ -137,7 +137,7 @@ Deno.test("UmlWriter", async (t) => { writer = new UmlWriter( FILE_PATH_TO_FLOW_DIFFERENCE, - mockGithubClient as unknown as GithubClient + mockGithubClient as unknown as GithubClient, ); await writer.writeUmlDiagrams(); // Make this await the async operation @@ -151,11 +151,11 @@ Deno.test("UmlWriter", async (t) => { // Verify that the methods were called the expected number of times assertSpyCalls( mockGithubClient.translateToComment, - FILE_PATH_TO_FLOW_DIFFERENCE.size + FILE_PATH_TO_FLOW_DIFFERENCE.size, ); assertSpyCalls( mockGithubClient.writeComment, - FILE_PATH_TO_FLOW_DIFFERENCE.size + FILE_PATH_TO_FLOW_DIFFERENCE.size, ); // Verify the content of the calls