Skip to content

Commit 7b63392

Browse files
committed
test: rename all test files to .mts extension and fix imports
1 parent 52fd970 commit 7b63392

141 files changed

Lines changed: 21 additions & 21 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

scripts/utils/changed-test-mapper.mjs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function mapSourceToTests(filepath) {
5252

5353
// Map specific files to their test files
5454
const basename = path.basename(normalized, path.extname(normalized))
55-
const testFile = `test/${basename}.test.ts`
55+
const testFile = `test/${basename}.test.mts`
5656

5757
// Check if corresponding test exists
5858
if (existsSync(path.join(rootPath, testFile))) {
@@ -61,16 +61,16 @@ function mapSourceToTests(filepath) {
6161

6262
// Special mappings
6363
if (normalized.includes('src/package-url.ts')) {
64-
return ['test/package-url.test.ts', 'test/integration.test.ts']
64+
return ['test/package-url.test.mts', 'test/integration.test.mts']
6565
}
6666
if (normalized.includes('src/package-url-builder.ts')) {
67-
return ['test/package-url-builder.test.ts', 'test/integration.test.ts']
67+
return ['test/package-url-builder.test.mts', 'test/integration.test.mts']
6868
}
6969
if (normalized.includes('src/url-converter.ts')) {
70-
return ['test/url-converter.test.ts']
70+
return ['test/url-converter.test.mts']
7171
}
7272
if (normalized.includes('src/result.ts')) {
73-
return ['test/result.test.ts']
73+
return ['test/result.test.mts']
7474
}
7575

7676
// If no specific mapping, run all tests to be safe
@@ -155,11 +155,11 @@ export function getTestsToRun(options = {}) {
155155
// Data changes run integration tests
156156
if (normalized.startsWith('data/')) {
157157
// Skip deleted files.
158-
if (existsSync(path.join(rootPath, 'test/integration.test.ts'))) {
159-
testFiles.add('test/integration.test.ts')
158+
if (existsSync(path.join(rootPath, 'test/integration.test.mts'))) {
159+
testFiles.add('test/integration.test.mts')
160160
}
161-
if (existsSync(path.join(rootPath, 'test/purl-types.test.ts'))) {
162-
testFiles.add('test/purl-types.test.ts')
161+
if (existsSync(path.join(rootPath, 'test/purl-types.test.mts'))) {
162+
testFiles.add('test/purl-types.test.mts')
163163
}
164164
}
165165
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020
writeJson,
2121
} from '@socketsecurity/lib/fs'
2222
import { describe, expect, it } from 'vitest'
23-
import { runWithTempDir } from '../unit/utils/temp-file-helper.mjs'
23+
import { runWithTempDir } from '../unit/utils/temp-file-helper'
2424

2525
describe('fs integration', () => {
2626
describe('JSON file operations', () => {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import path from 'node:path'
1515
import { findGitRoot } from '@socketsecurity/lib/git'
1616
import { spawn } from '@socketsecurity/lib/spawn'
1717
import { describe, expect, it } from 'vitest'
18-
import { runWithTempDir } from '../unit/utils/temp-file-helper.mjs'
18+
import { runWithTempDir } from '../unit/utils/temp-file-helper'
1919

2020
describe('git integration', () => {
2121
describe('repository detection', () => {

0 commit comments

Comments
 (0)