Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions exercises/practice/collatz-conjecture/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"authors": [],
"contributors": [
"ankorGH",
"jagdish-15",
"rchavarria",
"SleeplessByte",
"xarxziux"
Expand Down
2 changes: 1 addition & 1 deletion exercises/practice/collatz-conjecture/.meta/proof.ci.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const steps = (n) => {
if (n <= 0) {
throw new Error('Only positive numbers are allowed');
throw new Error('Only positive integers are allowed');
}

const iterate = (number, step) => {
Expand Down
23 changes: 20 additions & 3 deletions exercises/practice/collatz-conjecture/.meta/tests.toml
Original file line number Diff line number Diff line change
@@ -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.

[540a3d51-e7a6-47a5-92a3-4ad1838f0bfd]
description = "zero steps for one"
Expand All @@ -16,6 +23,16 @@ description = "large number of even and odd steps"

[7d4750e6-def9-4b86-aec7-9f7eb44f95a3]
description = "zero is an error"
include = false

[2187673d-77d6-4543-975e-66df6c50e2da]
description = "zero is an error"
reimplements = "7d4750e6-def9-4b86-aec7-9f7eb44f95a3"

[c6c795bf-a288-45e9-86a1-841359ad426d]
description = "negative value is an error"
include = false

[ec11f479-56bc-47fd-a434-bcd7a31a7a2e]
description = "negative value is an error"
reimplements = "c6c795bf-a288-45e9-86a1-841359ad426d"
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ describe('steps()', () => {
xtest('zero is an error', () => {
expect(() => {
steps(0);
}).toThrow(new Error('Only positive numbers are allowed'));
}).toThrow(new Error('Only positive integers are allowed'));
});

xtest('negative value is an error', () => {
expect(() => {
steps(-15);
}).toThrow(new Error('Only positive numbers are allowed'));
}).toThrow(new Error('Only positive integers are allowed'));
});
});