void.test.ts 738 B

12345678910111213141516171819202122232425262728293031
  1. import { describe, expect, it } from 'vitest'
  2. import { EMPTY_ARR, EMPTY_OBJ, noop } from './void'
  3. describe('void utilities', () => {
  4. describe('noop', () => {
  5. it('should return undefined', () => {
  6. expect(noop()).toBeUndefined()
  7. })
  8. })
  9. describe('EMPTY_OBJ', () => {
  10. it('should always return the same reference', () => {
  11. expect(EMPTY_OBJ).toBe(EMPTY_OBJ)
  12. })
  13. it('should be an empty object', () => {
  14. expect(Object.keys(EMPTY_OBJ)).toHaveLength(0)
  15. })
  16. })
  17. describe('EMPTY_ARR', () => {
  18. it('should always return the same reference', () => {
  19. expect(EMPTY_ARR).toBe(EMPTY_ARR)
  20. })
  21. it('should be an empty array', () => {
  22. expect(EMPTY_ARR).toHaveLength(0)
  23. })
  24. })
  25. })