Skip to content

Commit

Permalink
feat: support case-insensitive path matching in cli (fix vitest-dev#3567
Browse files Browse the repository at this point in the history
)
  • Loading branch information
tigranmk committed Jan 11, 2024
1 parent a73c1c2 commit e94185d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/vitesse/src/auto-import.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,5 @@ declare global {
// for type re-export
declare global {
// @ts-ignore
export type { Component, ComponentPublicInstance, ComputedRef, InjectionKey, PropType, Ref, VNode } from 'vue'
export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue'
}
2 changes: 1 addition & 1 deletion packages/vitest/src/node/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@ export class Vitest {
const specs = await project.globTestFiles(filters)
specs.forEach((file) => {
files.push([project, file])
const projects = this.projectsTestFiles.get(file) || new Set()
const projects = this.projectsTestFiles.get(file.toLocaleLowerCase()) || new Set()
projects.add(project)
this.projectsTestFiles.set(file, projects)
})
Expand Down
4 changes: 2 additions & 2 deletions packages/vitest/src/node/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,10 @@ export class WorkspaceProject {

if (filters.length) {
return testFiles.filter((t) => {
const testFile = relative(dir, t)
const testFile = relative(dir, t).toLocaleLowerCase()
return filters.some((f) => {
const relativePath = f.endsWith('/') ? join(relative(dir, f), '/') : relative(dir, f)
return testFile.includes(f) || testFile.includes(relativePath)
return testFile.includes(f.toLocaleLowerCase()) || testFile.includes(relativePath.toLocaleLowerCase())
})
})
}
Expand Down

0 comments on commit e94185d

Please sign in to comment.