Skip to content

Commit

Permalink
fixes error in utils
Browse files Browse the repository at this point in the history
  • Loading branch information
georgejecook committed Oct 25, 2023
1 parent 316e84c commit 05c379d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bsc-plugin/src/lib/rooibos/RooibosSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { diagnosticErrorNoMainFound as diagnosticWarnNoMainFound, diagnosticNoSt
import undent from 'undent';
import { BrsTranspileState } from 'brighterscript/dist/parser/BrsTranspileState';
import * as fsExtra from 'fs-extra';
import { MockUtil } from './MockUtil';
import type { MockUtil } from './MockUtil';

// eslint-disable-next-line
const pkg = require('../../../package.json');
Expand Down
4 changes: 2 additions & 2 deletions bsc-plugin/src/lib/rooibos/Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ export function getRootObjectFromDottedGet(value: brighterscript.DottedGetExpres
}

export function getStringPathFromDottedGet(value: brighterscript.DottedGetExpression) {
let parts = [this.getPathValuePartAsString(value)];
let parts = [getPathValuePartAsString(value)];
let root;
root = value.obj;
while (root) {
if (brighterscript.isCallExpression(root) || brighterscript.isCallfuncExpression(root)) {
return undefined;
}
parts.push(`${this.getPathValuePartAsString(root)}`);
parts.push(`${getPathValuePartAsString(root)}`);
root = root.obj;
}
let joinedParts = parts.reverse().join('.');
Expand Down
4 changes: 1 addition & 3 deletions bsc-plugin/src/plugin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1526,15 +1526,14 @@ describe('RooibosPlugin', () => {
});

describe('addTestRunnerMetadata', () => {
it.only('does not permanently modify the AST', async () => {
it('does not permanently modify the AST', async () => {
program.setFile('source/test.spec.bs', `
@suite
class ATest1
@describe("groupA")
@it("test1")
function _()
item = {id: "item"}
m.assertEqual(item, "wtf")
m.expectNotCalled(item.getFunction())
m.expectNotCalled(item.getFunction())
end function
Expand All @@ -1547,7 +1546,6 @@ describe('RooibosPlugin', () => {
@it("test1")
function _()
item = {id: "item"}
m.assertEqual(item, "wtf")
m.expectNotCalled(item.getFunction())
m.expectNotCalled(item.getFunction())
end function
Expand Down

0 comments on commit 05c379d

Please sign in to comment.