Skip to content

Commit

Permalink
chore: fix isTestFile in utils to include .tsx test files (#499)
Browse files Browse the repository at this point in the history
  • Loading branch information
BlankParticle authored Feb 20, 2024
1 parent af83160 commit ca7302d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/utils.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ export function isDemoFile(filename) {
}

export function isTestFile(filename) {
const hookTestRegex = new RegExp('^use[A-Z][a-zA-Z]*.test.ts$')
const hookTestRegex = new RegExp('^use[A-Z][a-zA-Z]*.test.tsx?$')
return hookTestRegex.test(filename)
}

export function camelToKebabCase(str) {
return str.replace(/[A-Z]/g, letter => `-${letter.toLowerCase()}`)
}

export const toQueryParams = (params) => {
export const toQueryParams = params => {
const paramsAsString = Object.entries(params)
.filter(([_, value]) => !!value)
.map(([key, value]) => `${key}=${value}`)
Expand Down

0 comments on commit ca7302d

Please sign in to comment.