diff --git a/bsc-plugin/src/lib/rooibos/RooibosSession.ts b/bsc-plugin/src/lib/rooibos/RooibosSession.ts index ac5608e0..a8573292 100644 --- a/bsc-plugin/src/lib/rooibos/RooibosSession.ts +++ b/bsc-plugin/src/lib/rooibos/RooibosSession.ts @@ -111,7 +111,7 @@ export class RooibosSession { diagnosticNoStagingDir(files[0]); } else { const filePath = path.join(this._builder.options.stagingDir ?? this._builder.options.stagingFolderPath, 'source/rooibosMain.brs'); - fsExtra.writeFileSync(filePath, `function main()\n Rooibos_init("${this.config?.testSceneName ?? 'RooibosScene'}")\nend function`); + fsExtra.outputFileSync(filePath, `function main()\n Rooibos_init("${this.config?.testSceneName ?? 'RooibosScene'}")\nend function`); } } diff --git a/bsc-plugin/src/plugin.spec.ts b/bsc-plugin/src/plugin.spec.ts index dbe5bcd4..619e914d 100644 --- a/bsc-plugin/src/plugin.spec.ts +++ b/bsc-plugin/src/plugin.spec.ts @@ -213,6 +213,29 @@ describe('RooibosPlugin', () => { expect(plugin.session.sessionInfo.testsCount).to.equal(0); }); + it('transpiles enums in component node tests', async () => { + const file = program.setFile('components/test.spec.bs', ` + enum Direction + up = "up" + end enum + namespace tests + @SGNode("Rectangle") + @suite("[Rectangle] Tests") + class ATest extends rooibos.BaseTestSuite + @describe("groupA") + + @it("is test1") + function Test() + print Direction.up + end function + end class + end namespace + `); + program.validate(); + const contents = await program.getTranspiledFileContents(file.pkgPath); + expect(contents.code).to.include('print "up"'); + }); + it('multiple groups', () => { program.setFile('source/test.spec.bs', ` @suite