-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Component statement support for <children>
and field attributes
#971
base: in-code-component
Are you sure you want to change the base?
Component statement support for <children>
and field attributes
#971
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good!
I'd like to see some unit tests to verify these features work and ensure they continue to work in the future. You can add them in ComponentStatement.spec.ts
and follow this existing test's model:
brighterscript/src/parser/tests/statement/ComponentStatement.spec.ts
Lines 327 to 348 in 086e267
it('adds private methods to codebehind as plain functions', async () => { | |
program.setFile('components/ZombieKeyboard.bs', ` | |
component ZombieKeyboard | |
private sub init() | |
'test | |
end sub | |
private sub doSomething() | |
print "do something" | |
end sub | |
end component | |
`); | |
await testTranspile(program.getFile('components/ZombieKeyboard.codebehind.brs'), ` | |
sub init() | |
'test | |
end sub | |
sub doSomething() | |
print "do something" | |
end sub | |
`); | |
}); |
Let's add at least one for each annotation type, but feel free to do more with variations on the annotation (like what happens if the annotation is present but missing the string for example). Maybe test a few with several annotations present at the same time, that type of thing.
You run them by calling npm run test:nocover
or by using the test
task in vscode.
Co-authored-by: Bronley Plumb <[email protected]>
Co-authored-by: Bronley Plumb <[email protected]>
<children>
and field attributes
…/github.com/rokucommunity/brighterscript into add-component-children-and-field-attributes
No description provided.