Skip to content

Commit

Permalink
test: update test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
chouchouji committed Oct 27, 2024
1 parent 6fcf91d commit 62ffa65
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/general.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,4 @@ export function getGlobalThis() {

export function isNonEmptyArray(val: unknown): val is Array<any> {
return isArray(val) && !!val.length
}
}
6 changes: 0 additions & 6 deletions tests/array.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
shuffle,
sum,
sumBy,
isNonEmptyArray,
} from '../src'

it('uniq', () => {
Expand Down Expand Up @@ -95,8 +94,3 @@ it('sum', () => {
it('sumBy', () => {
expect(sumBy([{ value: 1 }, { value: 2 }, { value: 3 }], (item) => item.value)).toBe(6)
})

it('isNonEmptyArray', () => {
expect(isNonEmptyArray([])).toBe(false)
expect(isNonEmptyArray([1, 2])).toBe(true)
})
7 changes: 7 additions & 0 deletions tests/general.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { it, expect } from 'vitest'
import { isNonEmptyArray } from '../src'

it('isNonEmptyArray', () => {
expect(isNonEmptyArray([])).toBe(false)
expect(isNonEmptyArray([1, 2])).toBe(true)
})

0 comments on commit 62ffa65

Please sign in to comment.