Skip to content

Commit fe12f28

Browse files
committed
test: explicit file extensions for import path
1 parent 65f8f02 commit fe12f28

11 files changed

+13
-13
lines changed

test/core/Exception.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect, test } from 'vitest';
2-
import Exception from '../../src';
2+
import Exception from '../../src/index.js';
33

44
test('Exception - constructor with no arguments should create an instance with default values', () => {
55
const exception = new Exception();

test/core/PaletteError.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import chalk from 'chalk';
22
import { expect, test } from 'vitest';
3-
import PaletteError from '../../src/core/PaletteError';
3+
import PaletteError from '../../src/core/PaletteError.js';
44

55
test('PaletteError - should create an instance with uncorrected error message', () => {
6-
const error = new PaletteError(undefined);
6+
const error = new PaletteError(undefined as any);
77
expect(error.message).toBe('');
88
});
99

test/core/TraceError.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect, test } from 'vitest';
2-
import TraceError from '../../src/core/TraceError';
2+
import TraceError from '../../src/core/TraceError.js';
33

44
test('trace - should return empty array when stack is empty', () => {
55
const traceError = new TraceError('');

test/helpers/get-address.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect, test } from 'vitest';
2-
import getAddress from '../../src/helpers/get-address';
2+
import getAddress from '../../src/helpers/get-address.js';
33

44
test('getAddress - should return empty string for invalid input', () => {
55
const text = '';

test/helpers/is-bg-rgb.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect, test } from 'vitest';
2-
import isBgRgb from '../../src/helpers/is-bg-rgb';
2+
import isBgRgb from '../../src/helpers/is-bg-rgb.js';
33

44
test('isBgRgb - should return true for valid background RGB color format', () => {
55
const value = 'bg(255,0,0)';

test/helpers/is-rgb.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect, test } from 'vitest';
2-
import isRgb from '../../src/helpers/is-rgb';
2+
import isRgb from '../../src/helpers/is-rgb.js';
33

44
test('isRgb - should return true for valid RGB color format', () => {
55
const value = '(255,0,0)';

test/helpers/is-string.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect, test } from 'vitest';
2-
import isString from '../../src/helpers/is-string';
2+
import isString from '../../src/helpers/is-string.js';
33

44
test('isString - should return true for string value', () => {
55
const value = 'Hello';

test/helpers/normalize-number.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect, test } from 'vitest';
2-
import normalizeNumber from '../../src/helpers/normalize-number';
2+
import normalizeNumber from '../../src/helpers/normalize-number.js';
33

44
test('normalizeNumber - should convert string to number', () => {
55
const value = '123';
@@ -27,7 +27,7 @@ test('normalizeNumber - should return NaN for undefined', () => {
2727

2828
test('normalizeNumber - should return NaN for null', () => {
2929
const value = null;
30-
const result = normalizeNumber(value);
30+
const result = normalizeNumber(value as any);
3131
expect(Number.isNaN(result)).toBe(true);
3232
});
3333

test/helpers/normalize-path.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect, test } from 'vitest';
2-
import normalizePath from '../../src/helpers/normalize-path';
2+
import normalizePath from '../../src/helpers/normalize-path.js';
33

44
test('normalizePath - should replace single backslashes with slashes', () => {
55
const path = 'C:\\Users\\User\\Documents\\file.txt';

test/helpers/normalize-rgb.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect, test } from 'vitest';
2-
import normalizeRgb from '../../src/helpers/normalize-rgb';
2+
import normalizeRgb from '../../src/helpers/normalize-rgb.js';
33

44
test('normalizeRgb - should normalize RGB color string', () => {
55
const color = '(255, 0, 0)';

test/helpers/normalize-track.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect, test } from 'vitest';
2-
import normalizeTrack from '../../src/helpers/normalize-track';
2+
import normalizeTrack from '../../src/helpers/normalize-track.js';
33

44
test('normalizeTrack - should extract and trim substring within specified range', () => {
55
const string_ = 'This is a test string.';

0 commit comments

Comments
 (0)