diff options
author | Ricardo Cino <ricardo@cino.io> | 2022-06-26 01:26:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-25 23:26:19 +0000 |
commit | 465b5772763ccb8d4970d4c55e30a518abb7be3e (patch) | |
tree | e929e34910dbf6a3958cdc4de77dc1dcae93e7b0 /test/helpers/array-helpers.test.ts | |
parent | chore: add more strict types in electron directory (#367) (diff) | |
download | ferdium-app-465b5772763ccb8d4970d4c55e30a518abb7be3e.tar.gz ferdium-app-465b5772763ccb8d4970d4c55e30a518abb7be3e.tar.zst ferdium-app-465b5772763ccb8d4970d4c55e30a518abb7be3e.zip |
chore: moved tests to ./test directory (#366)
* chore: allow coverage to be generated from non-tested files
Diffstat (limited to 'test/helpers/array-helpers.test.ts')
-rw-r--r-- | test/helpers/array-helpers.test.ts | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/helpers/array-helpers.test.ts b/test/helpers/array-helpers.test.ts new file mode 100644 index 000000000..e8060c2c4 --- /dev/null +++ b/test/helpers/array-helpers.test.ts | |||
@@ -0,0 +1,15 @@ | |||
1 | import { shuffleArray } from '../../src/helpers/array-helpers'; | ||
2 | |||
3 | describe('array_helpers', () => { | ||
4 | it('isValidExternalURL', () => { | ||
5 | const originalArray = ['a', 'b', 'c']; | ||
6 | const shuffledArray = shuffleArray(originalArray); | ||
7 | |||
8 | // Expect the arrays to not be exactly the same | ||
9 | expect(shuffledArray).not.toEqual(originalArray); | ||
10 | |||
11 | // Expect the arrays to be exactly the same | ||
12 | // when both are sorted alphabetically | ||
13 | expect(shuffledArray.sort()).toEqual(originalArray.sort()); | ||
14 | }); | ||
15 | }); | ||