diff --git a/packages/hot_hook/src/matcher.ts b/packages/hot_hook/src/matcher.ts index 448336d..126abd3 100644 --- a/packages/hot_hook/src/matcher.ts +++ b/packages/hot_hook/src/matcher.ts @@ -7,6 +7,7 @@ export class Matcher { constructor(rootDirectory: string, patterns: picomatch.Glob = []) { this.#rootDirectory = rootDirectory + console.log(this.#rootDirectory) patterns = Array.isArray(patterns) ? patterns : [patterns] const absolutePatterns = patterns @@ -16,6 +17,7 @@ export class Matcher { }) .map((path) => path.replace(/\\/g, '/')) + console.log(absolutePatterns) this.#matcher = picomatch(absolutePatterns || [], { dot: true }) } @@ -28,6 +30,7 @@ export class Matcher { filePath = filePath.slice(this.#rootDirectory.length).replace(/^\//, '') } + console.log({ filePath, match: this.#matcher(filePath) }) return this.#matcher(filePath) } } diff --git a/packages/hot_hook/tests/loader.spec.ts b/packages/hot_hook/tests/loader.spec.ts index 374211b..d70622f 100644 --- a/packages/hot_hook/tests/loader.spec.ts +++ b/packages/hot_hook/tests/loader.spec.ts @@ -268,5 +268,5 @@ test.group('Loader', () => { await setTimeout(100) await createHandlerFile({ path: 'app.js', response: 'Hello World! Updated new' }) await supertest('http://localhost:3333').get('/').expect(200).expect('Hello World! Updated new') - }) + }).pin() })