mirror of
https://gitea.smigz.com/smiggiddy/odin-codeprojects.git
synced 2024-12-25 22:10:43 -05:00
Merge branch 'main' into battleship
This commit is contained in:
commit
66f10a8345
4 changed files with 34 additions and 9589 deletions
|
@ -18,4 +18,5 @@ module.exports = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
9589
testing/package-lock.json
generated
9589
testing/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -25,6 +25,9 @@
|
||||||
"jest": "^29.7.0",
|
"jest": "^29.7.0",
|
||||||
"style-loader": "^3.3.3",
|
"style-loader": "^3.3.3",
|
||||||
"ts-jest": "^29.1.2",
|
"ts-jest": "^29.1.2",
|
||||||
|
"html-webpack-plugin": "^5.6.0",
|
||||||
|
"jest": "^29.7.0",
|
||||||
|
"style-loader": "^3.3.3",
|
||||||
"webpack": "^5.89.0",
|
"webpack": "^5.89.0",
|
||||||
"webpack-cli": "^5.1.4",
|
"webpack-cli": "^5.1.4",
|
||||||
"webpack-dev-server": "^4.15.1",
|
"webpack-dev-server": "^4.15.1",
|
||||||
|
|
30
testing/src/odinTests.test.js
Normal file
30
testing/src/odinTests.test.js
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
import {
|
||||||
|
analyzeArray,
|
||||||
|
ceaserCipher,
|
||||||
|
calculator,
|
||||||
|
reverseString,
|
||||||
|
capitalize,
|
||||||
|
} from './odinTests';
|
||||||
|
|
||||||
|
test('make sure mike = Mike', () => {
|
||||||
|
expect(capitalize('mike')).toBe('Mike');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('make sure mike = ekim', () => {
|
||||||
|
expect(reverseString('mike')).toBe('ekim');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Make sure calculator works', () => {
|
||||||
|
expect(calculator(1, 2, '+')).toBe(3);
|
||||||
|
expect(calculator(1, 2, '-')).toBe(-1);
|
||||||
|
expect(calculator(1, 2, '*')).toBe(2);
|
||||||
|
expect(calculator(1, 0, '/')).toBe('error');
|
||||||
|
expect(calculator(1, 2, '/')).toBe(0.5);
|
||||||
|
expect(ceaserCipher('bob')).toBe('ere');
|
||||||
|
expect(analyzeArray([1, 2, 3, 4])).toEqual({
|
||||||
|
average: 2.5,
|
||||||
|
min: 1,
|
||||||
|
max: 4,
|
||||||
|
length: 4,
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in a new issue