-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
296 additions
and
300 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"semi": false, // Specify if you want to print semicolons at the end of statements | ||
"singleQuote": true, // If you want to use single quotes | ||
"arrowParens": "avoid", // Include parenthesis around a sole arrow function parameter | ||
"semi": false, | ||
"singleQuote": true, | ||
"arrowParens": "avoid", | ||
"trailingComma": "es5" | ||
} |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
import WorldSimulation from "../worldSimulation.js"; | ||
import test from "ava"; | ||
import WorldSimulation from '../worldSimulation.js' | ||
import test from 'ava' | ||
|
||
test.beforeEach((t) => { | ||
t.context.worldSimulation = new WorldSimulation(); | ||
}); | ||
test.beforeEach(t => { | ||
t.context.worldSimulation = new WorldSimulation() | ||
}) | ||
|
||
test("must be able to get carrots", (t) => { | ||
const actual = t.context.worldSimulation.getCarrots(); | ||
test('must be able to get carrots', t => { | ||
const actual = t.context.worldSimulation.getCarrots() | ||
|
||
t.true(actual.length > 0); | ||
}); | ||
t.true(actual.length > 0) | ||
}) | ||
|
||
test("must be able to get animals", (t) => { | ||
const actual = t.context.worldSimulation.getAnimals(); | ||
test('must be able to get animals', t => { | ||
const actual = t.context.worldSimulation.getAnimals() | ||
|
||
t.true(actual.length > 0); | ||
}); | ||
t.true(actual.length > 0) | ||
}) | ||
|
||
test("must generate the current living world", (t) => { | ||
const actual = t.context.worldSimulation.generateEmojiGraph(); | ||
test('must generate the current living world', t => { | ||
const actual = t.context.worldSimulation.generateEmojiGraph() | ||
|
||
t.not(actual, ""); | ||
}); | ||
t.not(actual, '') | ||
}) |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
import { CARROTS_QUANTITY } from "../../constants.js"; | ||
import Carrot from "../carrot.js"; | ||
import test from "ava"; | ||
import { CARROTS_QUANTITY } from '../../constants.js' | ||
import Carrot from '../carrot.js' | ||
import test from 'ava' | ||
|
||
test.beforeEach((t) => { | ||
t.context.carrot = new Carrot(); | ||
}); | ||
test.beforeEach(t => { | ||
t.context.carrot = new Carrot() | ||
}) | ||
|
||
test("carrot must decrease by 1 when a carrot is eaten", (t) => { | ||
t.context.carrot.eaten(); | ||
test('carrot must decrease by 1 when a carrot is eaten', t => { | ||
t.context.carrot.eaten() | ||
|
||
const actual = t.context.carrot.getRemainingQuantity(); | ||
t.is(actual, CARROTS_QUANTITY - 1); | ||
}); | ||
const actual = t.context.carrot.getRemainingQuantity() | ||
t.is(actual, CARROTS_QUANTITY - 1) | ||
}) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
import Rabbit from "../rabbit.js"; | ||
import World from "../world.js"; | ||
import test from "ava"; | ||
import Rabbit from '../rabbit.js' | ||
import World from '../world.js' | ||
import test from 'ava' | ||
|
||
test.beforeEach((t) => { | ||
const world = new World(); | ||
t.context.rabbit = new Rabbit(world); | ||
}); | ||
test.beforeEach(t => { | ||
const world = new World() | ||
t.context.rabbit = new Rabbit(world) | ||
}) | ||
|
||
test("rabbit must be able to reproduce themself by default", (t) => { | ||
t.true(t.context.rabbit.canBeReproduced()); | ||
}); | ||
test('rabbit must be able to reproduce themself by default', t => { | ||
t.true(t.context.rabbit.canBeReproduced()) | ||
}) | ||
|
||
test("rabbit doesn't have barriers in front of them", (t) => { | ||
const size = { horizontal: 30, vertical: 40 }; | ||
t.true(t.context.rabbit.noBarriers(size, size)); | ||
}); | ||
test("rabbit doesn't have barriers in front of them", t => { | ||
const size = { horizontal: 30, vertical: 40 } | ||
t.true(t.context.rabbit.noBarriers(size, size)) | ||
}) | ||
|
||
test("set to new home-place must changes the position", (t) => { | ||
const currentHorizontalPosition = t.context.rabbit.position.horizontal; | ||
const currentVerticalPosition = t.context.rabbit.position.vertical; | ||
test('set to new home-place must changes the position', t => { | ||
const currentHorizontalPosition = t.context.rabbit.position.horizontal | ||
const currentVerticalPosition = t.context.rabbit.position.vertical | ||
|
||
t.context.rabbit.chase(); | ||
t.context.rabbit.setToNewPlace(); | ||
t.context.rabbit.chase() | ||
t.context.rabbit.setToNewPlace() | ||
|
||
t.is(currentHorizontalPosition, t.context.rabbit.position.horizontal); | ||
t.is(currentVerticalPosition, t.context.rabbit.position.vertical); | ||
}); | ||
t.is(currentHorizontalPosition, t.context.rabbit.position.horizontal) | ||
t.is(currentVerticalPosition, t.context.rabbit.position.vertical) | ||
}) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
import Wolf from "../wolf.js"; | ||
import World from "../world.js"; | ||
import test from "ava"; | ||
import Wolf from '../wolf.js' | ||
import World from '../world.js' | ||
import test from 'ava' | ||
|
||
test.beforeEach((t) => { | ||
const world = new World(); | ||
t.context.wolf = new Wolf(world); | ||
}); | ||
test.beforeEach(t => { | ||
const world = new World() | ||
t.context.wolf = new Wolf(world) | ||
}) | ||
|
||
test("wolf must be able to reproduce themself by default", (t) => { | ||
t.true(t.context.wolf.canBeReproduced()); | ||
}); | ||
test('wolf must be able to reproduce themself by default', t => { | ||
t.true(t.context.wolf.canBeReproduced()) | ||
}) | ||
|
||
test("wolf doesn't have barriers in front of them", (t) => { | ||
const size = { horizontal: 30, vertical: 40 }; | ||
t.true(t.context.wolf.noBarriers(size, size)); | ||
}); | ||
test("wolf doesn't have barriers in front of them", t => { | ||
const size = { horizontal: 30, vertical: 40 } | ||
t.true(t.context.wolf.noBarriers(size, size)) | ||
}) | ||
|
||
test("set to new home-place must changes the position", (t) => { | ||
const currentHorizontalPosition = t.context.wolf.position.horizontal; | ||
const currentVerticalPosition = t.context.wolf.position.vertical; | ||
test('set to new home-place must changes the position', t => { | ||
const currentHorizontalPosition = t.context.wolf.position.horizontal | ||
const currentVerticalPosition = t.context.wolf.position.vertical | ||
|
||
t.context.wolf.chase(); | ||
t.context.wolf.moveTowards(); | ||
t.context.wolf.chase() | ||
t.context.wolf.moveTowards() | ||
|
||
t.is(currentHorizontalPosition, t.context.wolf.position.horizontal); | ||
t.is(currentVerticalPosition, t.context.wolf.position.vertical); | ||
}); | ||
t.is(currentHorizontalPosition, t.context.wolf.position.horizontal) | ||
t.is(currentVerticalPosition, t.context.wolf.position.vertical) | ||
}) |
Oops, something went wrong.