Skip to content

Commit

Permalink
Merge pull request #270 from slheavner/slheavner/fix-createNodeFile-l…
Browse files Browse the repository at this point in the history
…ocation

Fix SGNode test generation
  • Loading branch information
chrisdp authored Feb 10, 2024
2 parents f2f9618 + e50f5f2 commit bb4aad9
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions bsc-plugin/src/lib/rooibos/RooibosSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,19 @@ export class RooibosSession {
prepareForTranspile(editor: AstEditor, program: Program, mockUtil: MockUtil) {
this.addTestRunnerMetadata(editor);
this.addLaunchHookToExistingMain(editor);

// Make sure to create the node files before running the global mock logic
// We realy on them in order to check the component scope for the global functions
for (let testSuite of this.sessionInfo.testSuitesToRun) {
if (testSuite.isNodeTest) {
this.createNodeFile(program, testSuite);
}
}

if (this.config.isGlobalMethodMockingEnabled && this.config.isGlobalMethodMockingEfficientMode) {
console.log('Efficient global stubbing is enabled');
this.namespaceLookup = this.getNamespaces(program);
for (let testSuite of this.sessionInfo.testSuitesToRun) {
if (testSuite.isNodeTest) {
this.createNodeFile(program, testSuite);
}
mockUtil.gatherGlobalMethodMocks(testSuite);
}

Expand Down

0 comments on commit bb4aad9

Please sign in to comment.