Revert "Merge branch 'jest'"

This reverts commit f76e9e108f.
This commit is contained in:
Marvin Gay
2021-05-12 21:47:42 -04:00
parent f76e9e108f
commit ad1c0c407f
45 changed files with 217 additions and 6166 deletions
+3 -2
View File
@@ -8,9 +8,10 @@ removeFromArray([1, 2, 3, 4], 3); // should remove 3 and return [1,2,4]
## Hints
The first test on this one is fairly easy, but there are a few things to think about(or google) here for the later tests:
the first test on this one is fairly easy, but there are a few things to think about(or google) here for the later tests:
- how to remove a single element from an array
- how to deal with multiple optional arguments in a javascript function
- [Check this link](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments). Scroll down to the bit about `Array.from` or the spread operator. - [Or this link](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters).
+2 -2
View File
@@ -1,5 +1,5 @@
const removeFromArray = function() {
};
}
module.exports = removeFromArray;
module.exports = removeFromArray
+8 -8
View File
@@ -1,25 +1,25 @@
const removeFromArray = require('./removeFromArray')
describe('removeFromArray', () => {
test('removes a single value', () => {
describe('removeFromArray', function() {
it('removes a single value', function() {
expect(removeFromArray([1, 2, 3, 4], 3)).toEqual([1, 2, 4]);
});
test.skip('removes multiple values', () => {
xit('removes multiple values', function() {
expect(removeFromArray([1, 2, 3, 4], 3, 2)).toEqual([1, 4]);
});
test.skip('ignores non present values', () => {
xit('ignores non present values', function() {
expect(removeFromArray([1, 2, 3, 4], 7, "tacos")).toEqual([1, 2, 3, 4]);
});
test.skip('ignores non present values, but still works', () => {
xit('ignores non present values, but still works', function() {
expect(removeFromArray([1, 2, 3, 4], 7, 2)).toEqual([1, 3, 4]);
});
test.skip('can remove all values', () => {
xit('can remove all values', function() {
expect(removeFromArray([1, 2, 3, 4], 1, 2, 3, 4)).toEqual([]);
});
test.skip('works with strings', () => {
xit('works with strings', function() {
expect(removeFromArray(["hey", 2, 3, "ho"], "hey", 3)).toEqual([2, "ho"]);
});
test.skip('only removes same type', () => {
xit('only removes same type', function() {
expect(removeFromArray([1, 2, 3], "1", 3)).toEqual([1, 2]);
});
});