From 8998db62fe59d11c455dfecd0fc3907033a4b218 Mon Sep 17 00:00:00 2001 From: Addison Date: Thu, 22 Aug 2024 11:52:40 -0400 Subject: [PATCH] Unit Tests for NodeClass Diagnostics --- src/plugin.spec.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/plugin.spec.ts b/src/plugin.spec.ts index a2aea54..0ec0359 100644 --- a/src/plugin.spec.ts +++ b/src/plugin.spec.ts @@ -569,6 +569,26 @@ describe('MaestroPlugin', () => { }); describe('node class tests', () => { + + it('gives diagnostics for generated nodeclass components', () => { + plugin.afterProgramCreate(program); + + program.setFile('source/VM.bs', ` + @node("MyNodeClass", "Group") + class VM + function new() + end function + end class + `); + program.validate(); + //the srcPath for this file should be relative to rootDir, not cwd + expect( + program.getFile('components/maestro/generated/MyNodeClass.xml').srcPath + ).to.eql( + s`${_rootDir}/components/maestro/generated/MyNodeClass.xml` + ); + }); + it('parses a node class with no errors', async () => { plugin.afterProgramCreate(program); program.setFile('source/comp.bs', `