Skip to content

Commit

Permalink
Unit Tests for NodeClass Diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
Addison committed Aug 22, 2024
1 parent e8fba61 commit 8998db6
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/plugin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', `
Expand Down

0 comments on commit 8998db6

Please sign in to comment.