Merge branch 'main' into battleship

This commit is contained in:
Mike 2024-04-02 16:45:41 -04:00 committed by GitHub
commit 66f10a8345
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 34 additions and 9589 deletions

View file

@ -18,4 +18,5 @@ module.exports = {
}, },
}, },
], ],
}; };

9589
testing/package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -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",

View 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,
});
});