Skip to content

Commit

Permalink
Multiply
Browse files Browse the repository at this point in the history
  • Loading branch information
PheRum committed Feb 1, 2024
1 parent 5a1dbce commit f61b7b7
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 7 deletions.
2 changes: 1 addition & 1 deletion 8kyu/Add Length/task.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
describe('Tests', () => {
it('test', () => {
it('addLength', () => {
expect(addLength('apple ban')).toEqual(['apple 5', 'ban 3']);
expect(addLength('you will win')).toEqual(['you 3', 'will 4', 'win 3']);
});
Expand Down
4 changes: 2 additions & 2 deletions 8kyu/Filter out the geese/task.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
describe('Basic tests', function () {
it('Mixed list', function () {
describe('Tests', function () {
it('gooseFilter', function () {
expect(gooseFilter(['Mallard', 'Hook Bill', 'African', 'Crested', 'Pilgrim', 'Toulouse', 'Blue Swedish'])).
toEqual(['Mallard', 'Hook Bill', 'Crested', 'Blue Swedish']);
});
Expand Down
2 changes: 1 addition & 1 deletion 8kyu/Grasshopper - Summation/task.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
describe('Tests', () => {
it('should return the correct total', function () {
it('summation', function () {
expect(summation(1)).toBe(1);
expect(summation(2)).toBe(3);
expect(summation(8)).toBe(36);
Expand Down
4 changes: 2 additions & 2 deletions 8kyu/Invert values/task.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
describe("Invert array values", () => {
it("Basic Tests", () => {
describe("Tests", () => {
it("invert", () => {
expect(invert([1, 2, 3, 4, 5])).toEqual([-1, -2, -3, -4, -5]);
expect(invert([1, -2, 3, -4, 5])).toEqual([-1, 2, -3, 4, -5]);
expect(invert([])).toEqual([]);
Expand Down
5 changes: 5 additions & 0 deletions 8kyu/Multiply/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Multiply

https://www.codewars.com/kata/50654ddff44f800200000004

This code does not execute properly. Try to figure out why.
3 changes: 3 additions & 0 deletions 8kyu/Multiply/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
function multiply($a, $b) {
return $a * $b;
}
10 changes: 10 additions & 0 deletions 8kyu/Multiply/task.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
describe('Tests', () => {
it('multiply', () => {
expect(multiply(1, 1)).toBe(1);
expect(multiply(2, 3)).toBe(6);
expect(multiply(3, 5)).toBe(15);
expect(multiply(5, 0)).toBe(0);
expect(multiply(0, 5)).toBe(0);
expect(multiply(0, 0)).toBe(0);
});
});
2 changes: 1 addition & 1 deletion 8kyu/The Feast of Many Beasts/task.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
describe('Tests', () => {
it('example', () => {
it('feast', () => {
expect(feast("great blue heron", "garlic naan")).toBe(true);
expect(feast("chickadee", "chocolate cake")).toBe(true);
expect(feast("brown bear", "bear claw")).toBe(false);
Expand Down

0 comments on commit f61b7b7

Please sign in to comment.