Last active
June 30, 2024 14:32
-
-
Save trikitrok/a1aec1d8cc29df988e04 to your computer and use it in GitHub Desktop.
Conway's rules tests initial names
This file contains hidden or 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
describe("rules", function() { | |
describe("rule to go on living", function() { | |
it("dies with more than 3 neighbors", function() { | |
expect(rules.goesOnLivingWith(4)).toBe(false); | |
}); | |
it("dies with less than 2 neighbors", function() { | |
expect(rules.goesOnLivingWith(1)).toBe(false); | |
}); | |
it("goes on living with 2 or 3 neighbors", function() { | |
expect(rules.goesOnLivingWith(3)).toBe(true); | |
expect(rules.goesOnLivingWith(2)).toBe(true); | |
}); | |
}); | |
describe("rule to be created", function() { | |
it("is created with 3 neighbors", function () { | |
expect(rules.isCreatedWith(3)).toBe(true); | |
}); | |
it("is not created with less than 3 neighbors", function () { | |
expect(rules.isCreatedWith(1)).toBe(false); | |
}); | |
it("is not created with more than 3 neighbors", function () { | |
expect(rules.isCreatedWith(4)).toBe(false); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment