Skip to content

Commit

Permalink
test: re-enable test
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Jan 25, 2025
1 parent f6390b4 commit 93c1904
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/util/file-path.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('validateEntryFiles', () => {
validateEntryFiles(['index.js', 'index/index.ts']),
).toThrowError('Conflicted entry files found for entries: .')
})
it.only('should throw error if the normalized base names are same', () => {
it('should throw error if the normalized base names are same', () => {
expect(() => validateEntryFiles(['foo/index.jsx', 'foo.ts'])).toThrowError(
'Conflicted entry files found for entries: ./foo',
)
Expand Down
7 changes: 4 additions & 3 deletions src/util/file-path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ export function validateEntryFiles(entryFiles: string[]) {
.slice(0, -path.extname(filePath).length)
.replace(/\\/g, '/')
const segments = filePathWithoutExt.split('/')
const lastSegment = segments.pop() || ''

if (lastSegment !== 'index' && lastSegment !== '') {
segments.push(lastSegment)
let lastSegment = segments[segments.length - 1]
while (lastSegment && (lastSegment === 'index' || lastSegment === '')) {
segments.pop()
lastSegment = segments[segments.length - 1]
}
const fileBasePath = segments.join('/')

Expand Down
3 changes: 2 additions & 1 deletion vitest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ export default defineConfig({
'**/test/fixtures/**',
],
// Test timeout
testTimeout: 60000,
testTimeout: 60 * 1000,
hookTimeout: 20 * 1000,
},
resolve: {
conditions: ['import', 'default'], // Prefer ES modules if available
Expand Down

0 comments on commit 93c1904

Please sign in to comment.