Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: remove lodash, add fast-deep-equal (#6496)
- Loading branch information
1 parent
8302fb7
commit 350a70f
Showing
11 changed files
with
619 additions
and
514 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
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { getName } from '../../test/util'; | ||
import { sampleSize } from '.'; | ||
|
||
describe(getName(__filename), () => { | ||
describe('sampleSize', () => { | ||
const array = ['a', 'b', 'c', 'd']; | ||
it('returns correct sized array', () => { | ||
expect(sampleSize(array, 2)).toHaveLength(2); | ||
}); | ||
it('returns full array for undefined number', () => { | ||
expect(sampleSize(array, undefined)).toEqual(array); | ||
}); | ||
it('returns full array for null number', () => { | ||
expect(sampleSize(array, null)).toEqual([]); | ||
}); | ||
it('returns full array for 0 number', () => { | ||
expect(sampleSize(array, 0)).toEqual([]); | ||
}); | ||
it('returns empty array for null array', () => { | ||
expect(sampleSize(null, 1)).toEqual([]); | ||
}); | ||
it('returns empty array for undefined array', () => { | ||
expect(sampleSize(undefined, 1)).toEqual([]); | ||
}); | ||
it('returns empty array for empty array', () => { | ||
expect(sampleSize([], 1)).toEqual([]); | ||
}); | ||
}); | ||
}); |
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
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
Oops, something went wrong.