From 7721a4d791b8536a6ccab05766cac4de9cefd62c Mon Sep 17 00:00:00 2001 From: Tyler Smith Date: Wed, 21 Aug 2024 14:25:19 -0300 Subject: [PATCH] Allow exemptions --- src/findNodes.spec.ts | 30 ++++++++++++++++++++++++++++-- src/findNodes.ts | 16 ++++++++++++++-- 2 files changed, 42 insertions(+), 4 deletions(-) diff --git a/src/findNodes.spec.ts b/src/findNodes.spec.ts index 85e1344..7c6a6b1 100644 --- a/src/findNodes.spec.ts +++ b/src/findNodes.spec.ts @@ -229,10 +229,12 @@ describe('findnode', () => { `); }); - it('it works when provide an excludeFiles config', async () => { program.options.autoFindNode = { - 'excludeFiles': ['components/noreplace/**/*'] + 'excludeFiles': [ + 'components/noreplace/**/*', + "!components/noreplace/sub/**/*" + ] }; program.setFile('components/replace/BaseKeyboard.bs', ` @@ -280,5 +282,29 @@ describe('findnode', () => { m.helloText.text = "HELLO ZOMBIE" end sub `); + + // Now we test the same code in the folder that should be excluded + program.setFile('components/noreplace/sub/BaseKeyboard.bs', ` + sub init() + m.helloText.text = "HELLO ZOMBIE" + end sub + `); + + program.setFile('components/noreplace/sub/BaseKeyboard.xml', ` + +