Skip to content

Commit

Permalink
fix(node-tests): fixes node tests not running (#147)
Browse files Browse the repository at this point in the history
  • Loading branch information
georgejecook authored Jan 19, 2022
1 parent 0c69f53 commit f38dbc1
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 49 deletions.
4 changes: 1 addition & 3 deletions bsc-plugin/src/lib/rooibos/RooibosSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,7 @@ end function`);
let method = classStatement.methods.find((m) => m.name.text === 'getAllTestSuitesNames');
if (method) {
let text = `return [
${this.sessionInfo.testSuitesToRun.filter((s) => !s.isNodeTest)
.map((s) => `"${s.name}"`).join('\n')
}
${this.sessionInfo.testSuitesToRun.map((s) => `"${s.name}"`).join('\n')}
]`;
method.func.body.statements.push(new RawCodeStatement(text));
}
Expand Down
59 changes: 17 additions & 42 deletions bsc-plugin/src/plugin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -543,41 +543,28 @@ end function`).trim());

});

describe.skip('run a local project', () => {
describe.only('run a local project', () => {
it('sanity checks on parsing - only run this outside of ci', () => {
let programBuilder = new ProgramBuilder();
let swv = {
'stagingFolderPath': 'build',
'rootDir': '/home/george/hope/open-source/maestro/swerve-app/src',
'files': [
'manifest',
'source/**/*.*',
'images/**/*.*',
'sounds/**/*.*',
'sounds/*.*',
'fonts/**/*.*',
'components/**/*.*'
],
'rootDir': '/home/george/hope/open-source/rooibos/tests',
'files': ['manifest', 'source/**/*.*', 'components/**/*.*'],
'autoImportComponentScript': true,
'createPackage': false,
'diagnosticFilters': [
{
'src': '**/roku_modules/**/*.*'
},
{
'src': '**/Whitelist.xml',
'codes': [
1067
]
},
{
'src': 'components/maestro/generated/**/*.*'
},
1013,
{
'src': '**/RALETrackerTask.*'
'src': '**/roku_modules/**/*.*',
'codes': [1107, 1009]
}
],
'rooibos': {
'showOnlyFailures': true,
'catchCrashes': true,
'lineWidth': 70,
'failFast': false,
'sendHomeOnFinish': false
},
'maestro': {
'nodeFileDelay': 0,
'excludeFilters': [
Expand All @@ -594,30 +581,18 @@ describe.skip('run a local project', () => {
'exclude': {
'id': '/home/george/hope/open-source/maestro/roku-log-bsc-plugin/dist/plugin.js'
},
'rooibos': {
'isRecordingCodeCoverage': false,
'testsFilePattern': null,
'tags': [
'!integration',
'!deprecated',
'!fixme'
],
'showOnlyFailures': true,
'catchCrashes': true,
'lineWidth': 70
},
'rokuLog': {
'strip': false,
'insertPkgPath': true
}
};

programBuilder.run(
swv
// {
// project: '/home/george/hope/applicaster/zapp-roku-app/bsconfig-test.json'
// project: '/home/george/hope/open-source/maestro/swerve-app/bsconfig-test.json'
// }
// swv
{
project: '/home/george/hope/open-source/rooibos/tests/bsconfig.json'
// project: '/home/george/hope/open-source/maestro/swerve-app/bsconfig-test.json'
}
).catch(e => {
console.error(e);
});
Expand Down
1 change: 1 addition & 0 deletions framework/src/source/BaseTestSuite.bs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ namespace rooibos
m.lineNumber = data.lineNumber
m.isNodeTest = data.isNodeTest
m.nodeName = data.nodeName
m.generatedNodeName = data.generatedNodeName
m.isFailingFast = false
m.stats = new Stats()
end if
Expand Down
4 changes: 2 additions & 2 deletions framework/src/source/TestRunner.bs
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ namespace rooibos

public function runInNodeMode(nodeTestName)
'bs:disable-next-line
suiteClass = m.getTestSuiteClassWithName(nodeTestName)
suiteClass = m.runtimeConfig.getTestSuiteClassWithName(nodeTestName)
testSuite = invalid

if suiteClass <> invalid
testSuite = suiteClass(m.top)
testSuite = suiteClass()
end if

if testSuite <> invalid
Expand Down
4 changes: 2 additions & 2 deletions tests/src/source/NodeExample.spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ namespace tests
end function

'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@describe("tests methods present on the node")
@describe("tests methods present on the node")
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

@it("HelloFromNode")
function _()
'bs:disable-next-line
text = HelloFromNode("georgejecook", 12)
m.AssertEqual(text, "HELLO georgejecook" + " age:" + stri(12))
m.AssertEqual(text, "HELLO georgejecook" + " aged:" + stri(12))
end function

@it("HelloFromNode with params")
Expand Down

0 comments on commit f38dbc1

Please sign in to comment.