Skip to content

Commit

Permalink
fix(gatsby-plugin-page-creator): Fix regular expression for validate …
Browse files Browse the repository at this point in the history
…path (#11862)
  • Loading branch information
sidharthachatterjee authored and pieh committed Feb 18, 2019
1 parent 0fe432c commit 898873d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Expand Up @@ -109,6 +109,14 @@ describe(`JavaScript page creator`, () => {
)
})

it(`doesn't filter out test.js`, () => {
const validFiles = [{ path: `src/pages/test.js` }]

expect(validFiles.filter(file => validatePath(file.path))).toEqual(
validFiles
)
})

describe(`create-path`, () => {
it(`should create unix paths`, () => {
const basePath = `/a/`
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-page-creator/src/validate-path.js
Expand Up @@ -8,7 +8,7 @@ const jsonYamlExtTest = /\.(json|ya?ml)$/
function isTestFile(filePath) {
const testPatterns = [
`**/__tests__/**/*.(js|ts)?(x)`,
`**/?(*.)+(spec|test).(js|ts)?(x)`,
`**/(*.)+(spec|test).(js|ts)?(x)`,
]

return mm.isMatch(filePath, testPatterns)
Expand Down

0 comments on commit 898873d

Please sign in to comment.