diff --git a/tests/array.spec.ts b/tests/array.spec.ts index 2bb78b5..f96bc74 100644 --- a/tests/array.spec.ts +++ b/tests/array.spec.ts @@ -12,7 +12,7 @@ import { shuffle, sum, sumBy, -} from '../src/array' +} from '../src' it('uniq', () => { const arr = uniq([1, 2, 2, 3, 4, 4]) diff --git a/tests/file.spec.ts b/tests/file.spec.ts index 7eaed45..46ae850 100644 --- a/tests/file.spec.ts +++ b/tests/file.spec.ts @@ -1,36 +1,36 @@ -import { describe, it, expect, beforeEach } from 'vitest'; -import { toDataURL, toText, toArrayBuffer } from '../src/file'; +import { describe, it, expect, beforeEach } from 'vitest' +import { toDataURL, toText, toArrayBuffer } from '../src' describe('file', () => { - let file: File; + let file: File beforeEach(() => { - const blob = new Blob(['Hello, World!'], { type: 'text/plain' }); - file = new File([blob], 'hello.txt', { type: 'text/plain' }); - }); + const blob = new Blob(['Hello, World!'], { type: 'text/plain' }) + file = new File([blob], 'hello.txt', { type: 'text/plain' }) + }) describe('toDataURL', () => { it('should convert file to data URL', async () => { - const dataURL = await toDataURL(file); - expect(dataURL).toMatch(/^data:text\/plain;base64,/); - }); - }); + const dataURL = await toDataURL(file) + expect(dataURL).toMatch(/^data:text\/plain;base64,/) + }) + }) describe('toText', () => { it('should read file as text', async () => { - const text = await toText(file); - expect(text).toBe('Hello, World!'); - }); - }); + const text = await toText(file) + expect(text).toBe('Hello, World!') + }) + }) describe('toArrayBuffer', () => { it('should read file as array buffer', async () => { - const arrayBuffer = await toArrayBuffer(file); - expect(arrayBuffer).toBeInstanceOf(ArrayBuffer); + const arrayBuffer = await toArrayBuffer(file) + expect(arrayBuffer).toBeInstanceOf(ArrayBuffer) - const uint8Array = new Uint8Array(arrayBuffer); - const text = new TextDecoder().decode(uint8Array); - expect(text).toBe('Hello, World!'); - }); - }); -}); \ No newline at end of file + const uint8Array = new Uint8Array(arrayBuffer) + const text = new TextDecoder().decode(uint8Array) + expect(text).toBe('Hello, World!') + }) + }) +}) diff --git a/tests/general.spec.ts b/tests/general.spec.ts index 1b7b636..2ee07f0 100644 --- a/tests/general.spec.ts +++ b/tests/general.spec.ts @@ -23,7 +23,7 @@ import { isTruthy, toRawType, hasOwn, -} from '../src/general' +} from '../src' it('isNonEmptyArray', () => { expect(isNonEmptyArray([])).toBe(false) diff --git a/tests/json.spec.ts b/tests/json.spec.ts index c7bbd39..8c1a4eb 100644 --- a/tests/json.spec.ts +++ b/tests/json.spec.ts @@ -1,5 +1,5 @@ import { describe, it, expect } from 'vitest' -import { tryParseJSON, prettyJSONObject } from '../src/json' +import { tryParseJSON, prettyJSONObject } from '../src' describe('JSON utility functions', () => { it('should parse valid JSON strings', () => { diff --git a/tests/number.spec.ts b/tests/number.spec.ts index b7771e2..e884a92 100644 --- a/tests/number.spec.ts +++ b/tests/number.spec.ts @@ -1,5 +1,5 @@ import { describe, it, expect } from 'vitest' -import { toNumber, clamp, clampArrayRange, genNumberKey, randomNumber } from '../src/number' +import { toNumber, clamp, clampArrayRange, genNumberKey, randomNumber } from '../src' describe('Number utility functions', () => { it('should convert various types to number', () => { diff --git a/tests/storage.spec.ts b/tests/storage.spec.ts index 3dc7143..1b974f0 100644 --- a/tests/storage.spec.ts +++ b/tests/storage.spec.ts @@ -1,5 +1,5 @@ import { describe, it, expect, beforeEach, vi } from 'vitest' -import { createStorage, sessionStorage, localStorage } from '../src/storage' +import { createStorage, sessionStorage, localStorage } from '../src' describe('Storage utility functions', () => { let mockStorage: Storage @@ -9,7 +9,7 @@ describe('Storage utility functions', () => { mockStorage = { length: 0, clear: vi.fn(() => { - Object.keys(store).forEach(key => { + Object.keys(store).forEach((key) => { delete store[key] }) }), diff --git a/tests/string.spec.ts b/tests/string.spec.ts index 1e46445..0bb11f6 100644 --- a/tests/string.spec.ts +++ b/tests/string.spec.ts @@ -1,5 +1,5 @@ import { describe, it, expect } from 'vitest' -import { pascalCase, camelize, kebabCase, slash, genStringKey, capitalizeFirstLetter } from '../src/string' +import { pascalCase, camelize, kebabCase, slash, genStringKey, capitalizeFirstLetter } from '../src' describe('string utility functions', () => { it('should convert string to pascal case', () => {