From a2fe798c9cf5eac0fc8242f73e884f7132860eaa Mon Sep 17 00:00:00 2001 From: Jagdish Prajapati Date: Mon, 23 Jun 2025 23:52:30 +0530 Subject: [PATCH 1/4] Sync toml file --- .../practice/phone-number/.meta/tests.toml | 33 +++++++++++++++++-- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/exercises/practice/phone-number/.meta/tests.toml b/exercises/practice/phone-number/.meta/tests.toml index 6365e12c08..24dbf07a76 100644 --- a/exercises/practice/phone-number/.meta/tests.toml +++ b/exercises/practice/phone-number/.meta/tests.toml @@ -1,6 +1,13 @@ -# This is an auto-generated file. Regular comments will be removed when this -# file is regenerated. Regenerating will not touch any manually added keys, -# so comments can be added in a "comment" key. +# This is an auto-generated file. +# +# Regenerating this file via `configlet sync` will: +# - Recreate every `description` key/value pair +# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications +# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion) +# - Preserve any other key/value pair +# +# As user-added comments (using the # character) will be removed when this file +# is regenerated, comments can be added via a `comment` key. [79666dce-e0f1-46de-95a1-563802913c35] description = "cleans the number" @@ -13,6 +20,11 @@ description = "cleans numbers with multiple spaces" [598d8432-0659-4019-a78b-1c6a73691d21] description = "invalid when 9 digits" +include = false + +[2de74156-f646-42b5-8638-0ef1d8b58bc2] +description = "invalid when 9 digits" +reimplements = "598d8432-0659-4019-a78b-1c6a73691d21" [57061c72-07b5-431f-9766-d97da7c4399d] description = "invalid when 11 digits does not start with a 1" @@ -25,12 +37,27 @@ description = "valid when 11 digits and starting with 1 even with punctuation" [c6a5f007-895a-4fc5-90bc-a7e70f9b5cad] description = "invalid when more than 11 digits" +include = false + +[4a1509b7-8953-4eec-981b-c483358ff531] +description = "invalid when more than 11 digits" +reimplements = "c6a5f007-895a-4fc5-90bc-a7e70f9b5cad" [63f38f37-53f6-4a5f-bd86-e9b404f10a60] description = "invalid with letters" +include = false + +[eb8a1fc0-64e5-46d3-b0c6-33184208e28a] +description = "invalid with letters" +reimplements = "63f38f37-53f6-4a5f-bd86-e9b404f10a60" [4bd97d90-52fd-45d3-b0db-06ab95b1244e] description = "invalid with punctuations" +include = false + +[065f6363-8394-4759-b080-e6c8c351dd1f] +description = "invalid with punctuations" +reimplements = "4bd97d90-52fd-45d3-b0db-06ab95b1244e" [d77d07f8-873c-4b17-8978-5f66139bf7d7] description = "invalid if area code starts with 0" From 94576a66204365feac2952ba6b9e45ebf7975069 Mon Sep 17 00:00:00 2001 From: Jagdish Prajapati Date: Mon, 23 Jun 2025 23:53:16 +0530 Subject: [PATCH 2/4] Update test file --- exercises/practice/phone-number/phone-number.spec.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exercises/practice/phone-number/phone-number.spec.js b/exercises/practice/phone-number/phone-number.spec.js index db5b0f396a..e3ae5be50b 100644 --- a/exercises/practice/phone-number/phone-number.spec.js +++ b/exercises/practice/phone-number/phone-number.spec.js @@ -17,7 +17,7 @@ describe('Phone Number', () => { xtest('invalid when 9 digits', () => { expect(() => clean('123456789')).toThrow( - new Error('Incorrect number of digits'), + new Error('Must not be fewer than 10 digits'), ); }); @@ -37,18 +37,18 @@ describe('Phone Number', () => { xtest('invalid when more than 11 digits', () => { expect(() => clean('321234567890')).toThrow( - new Error('More than 11 digits'), + new Error('Must not be greater than 11 digits'), ); }); xtest('invalid with letters', () => { - expect(() => clean('123-abc-7890')).toThrow( + expect(() => clean('523-abc-7890')).toThrow( new Error('Letters not permitted'), ); }); xtest('invalid with punctuations', () => { - expect(() => clean('123-@:!-7890')).toThrow( + expect(() => clean('523-@:!-7890')).toThrow( new Error('Punctuations not permitted'), ); }); From 005bd036ff79ef1fa6734fe518ca2a51076504a2 Mon Sep 17 00:00:00 2001 From: Jagdish Prajapati Date: Mon, 23 Jun 2025 23:53:39 +0530 Subject: [PATCH 3/4] Update proof solution --- exercises/practice/phone-number/.meta/proof.ci.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/practice/phone-number/.meta/proof.ci.js b/exercises/practice/phone-number/.meta/proof.ci.js index d72bfbc643..ba7cdb3f92 100644 --- a/exercises/practice/phone-number/.meta/proof.ci.js +++ b/exercises/practice/phone-number/.meta/proof.ci.js @@ -17,11 +17,11 @@ export const clean = (number) => { } if (numberLength < 10) { - throw new Error('Incorrect number of digits'); + throw new Error('Must not be fewer than 10 digits'); } if (numberLength > 11) { - throw new Error('More than 11 digits'); + throw new Error('Must not be greater than 11 digits'); } if (strippedNumber.substring(0, 1) === '0') { From ab208cd369045fb890a58f1e7e99329f7776a4f9 Mon Sep 17 00:00:00 2001 From: Jagdish Prajapati Date: Mon, 23 Jun 2025 23:53:54 +0530 Subject: [PATCH 4/4] Configure config.json --- exercises/practice/phone-number/.meta/config.json | 1 + 1 file changed, 1 insertion(+) diff --git a/exercises/practice/phone-number/.meta/config.json b/exercises/practice/phone-number/.meta/config.json index 1896873090..66b2bd7569 100644 --- a/exercises/practice/phone-number/.meta/config.json +++ b/exercises/practice/phone-number/.meta/config.json @@ -5,6 +5,7 @@ "contributors": [ "ankorGH", "draalger", + "jagdish-15", "kytrinyx", "LyleCharlesScott", "matthewmorgan",