From e757af49a3f50adb8972471742fe61ea64241aed Mon Sep 17 00:00:00 2001 From: Bronley Plumb Date: Tue, 1 Oct 2024 13:56:33 -0400 Subject: [PATCH] Upgade to brighterscript@1.0.0-alpha.38 --- bsc-plugin/package-lock.json | 30 +++++++++---------- bsc-plugin/package.json | 2 +- .../src/lib/rooibos/CodeCoverageProcessor.ts | 3 -- .../src/lib/rooibos/RawCodeExpression.ts | 8 +++-- .../src/lib/rooibos/RawCodeStatement.ts | 8 +++++ .../src/lib/rooibos/TestSuiteBuilder.spec.ts | 1 - .../src/lib/rooibos/TestSuiteBuilder.ts | 4 ++- 7 files changed, 32 insertions(+), 24 deletions(-) diff --git a/bsc-plugin/package-lock.json b/bsc-plugin/package-lock.json index c3a4ea5..7753ea6 100644 --- a/bsc-plugin/package-lock.json +++ b/bsc-plugin/package-lock.json @@ -22,7 +22,7 @@ "@types/node": "^14.18.41", "@typescript-eslint/eslint-plugin": "^5.27.0", "@typescript-eslint/parser": "^5.27.0", - "brighterscript": "^1.0.0-alpha.36", + "brighterscript": "^1.0.0-alpha.38", "chai": "^4.2.0", "chai-subset": "^1.6.0", "coveralls": "^3.0.0", @@ -2393,9 +2393,9 @@ } }, "node_modules/brighterscript": { - "version": "1.0.0-alpha.36", - "resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-1.0.0-alpha.36.tgz", - "integrity": "sha512-VzrdKfjabf/fWfiyMzIv1wLZtIxCf5BjDTYoSCUB5fLDeYLyl6fapRPdaBfj02uhDNp4GCk29dGiFlLK+eEyBA==", + "version": "1.0.0-alpha.38", + "resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-1.0.0-alpha.38.tgz", + "integrity": "sha512-x16tI2juW+UcTGKZ9UoxZDk70ZKDKmGskuklXrsTH1D8onnRdJrSQtejfBeczPvhP1/khxE4qzoLppSpfVhqqg==", "dev": true, "dependencies": { "@rokucommunity/bslib": "^0.1.1", @@ -6690,12 +6690,12 @@ } }, "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, "dependencies": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" }, "engines": { @@ -12513,9 +12513,9 @@ } }, "brighterscript": { - "version": "1.0.0-alpha.36", - "resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-1.0.0-alpha.36.tgz", - "integrity": "sha512-VzrdKfjabf/fWfiyMzIv1wLZtIxCf5BjDTYoSCUB5fLDeYLyl6fapRPdaBfj02uhDNp4GCk29dGiFlLK+eEyBA==", + "version": "1.0.0-alpha.38", + "resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-1.0.0-alpha.38.tgz", + "integrity": "sha512-x16tI2juW+UcTGKZ9UoxZDk70ZKDKmGskuklXrsTH1D8onnRdJrSQtejfBeczPvhP1/khxE4qzoLppSpfVhqqg==", "dev": true, "requires": { "@rokucommunity/bslib": "^0.1.1", @@ -15686,12 +15686,12 @@ "dev": true }, "micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, "requires": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" } }, diff --git a/bsc-plugin/package.json b/bsc-plugin/package.json index 0baf76c..19fefe8 100644 --- a/bsc-plugin/package.json +++ b/bsc-plugin/package.json @@ -42,7 +42,7 @@ "@types/node": "^14.18.41", "@typescript-eslint/eslint-plugin": "^5.27.0", "@typescript-eslint/parser": "^5.27.0", - "brighterscript": "^1.0.0-alpha.36", + "brighterscript": "^1.0.0-alpha.38", "chai": "^4.2.0", "chai-subset": "^1.6.0", "coveralls": "^3.0.0", diff --git a/bsc-plugin/src/lib/rooibos/CodeCoverageProcessor.ts b/bsc-plugin/src/lib/rooibos/CodeCoverageProcessor.ts index ff10764..9b61993 100644 --- a/bsc-plugin/src/lib/rooibos/CodeCoverageProcessor.ts +++ b/bsc-plugin/src/lib/rooibos/CodeCoverageProcessor.ts @@ -130,9 +130,6 @@ export class CodeCoverageProcessor { ForEachStatement: (ds, parent, owner, key) => { this.addStatement(ds); ds.tokens.forEach.text = `${this.getFuncCallText(ds.location.range.start.line, CodeCoverageLineType.code)}: for each`; - }, - ExitWhileStatement: (ds, parent, owner, key) => { - }, PrintStatement: (ds, parent, owner, key) => { this.addStatement(ds); diff --git a/bsc-plugin/src/lib/rooibos/RawCodeExpression.ts b/bsc-plugin/src/lib/rooibos/RawCodeExpression.ts index 05b8e80..b927c25 100644 --- a/bsc-plugin/src/lib/rooibos/RawCodeExpression.ts +++ b/bsc-plugin/src/lib/rooibos/RawCodeExpression.ts @@ -1,6 +1,4 @@ -import type { BscFile, - WalkOptions, - WalkVisitor } from 'brighterscript'; +import type { BscFile, WalkOptions, WalkVisitor } from 'brighterscript'; import { Expression } from 'brighterscript'; import * as brighterscript from 'brighterscript'; import type { BrsTranspileState } from 'brighterscript/dist/parser/BrsTranspileState'; @@ -33,4 +31,8 @@ export class RawCodeExpression extends Expression { public walk(visitor: WalkVisitor, options: WalkOptions) { //nothing to walk } + + public clone() { + return new RawCodeExpression(this.source, this.sourceFile, brighterscript.util.cloneLocation({ range: this.range } as any).range); + } } diff --git a/bsc-plugin/src/lib/rooibos/RawCodeStatement.ts b/bsc-plugin/src/lib/rooibos/RawCodeStatement.ts index fc93099..9261473 100644 --- a/bsc-plugin/src/lib/rooibos/RawCodeStatement.ts +++ b/bsc-plugin/src/lib/rooibos/RawCodeStatement.ts @@ -47,6 +47,10 @@ export class RawCodeStatement extends Statement { public walk(visitor: WalkVisitor, options: WalkOptions) { //nothing to walk } + + public clone() { + return new RawCodeStatement(this.source, this.sourceFile, util.cloneLocation({ range: this.range } as any).range); + } } export class RawCodeExpression extends Expression { @@ -81,4 +85,8 @@ export class RawCodeExpression extends Expression { public walk(visitor: WalkVisitor, options: WalkOptions) { //nothing to walk } + + public clone() { + return new RawCodeExpression(this.source, this.sourceFile, util.cloneLocation({ range: this.range } as any).range); + } } diff --git a/bsc-plugin/src/lib/rooibos/TestSuiteBuilder.spec.ts b/bsc-plugin/src/lib/rooibos/TestSuiteBuilder.spec.ts index 130a4a3..94ef2ca 100644 --- a/bsc-plugin/src/lib/rooibos/TestSuiteBuilder.spec.ts +++ b/bsc-plugin/src/lib/rooibos/TestSuiteBuilder.spec.ts @@ -1115,7 +1115,6 @@ end namespace @suite("Rooibos assertion tests") class AssertionTests extends rooibos.BaseTestSuite @describe("group1") - @it("one") @params("http://google.com/thing", true) @params("#'_!!@#%", false) diff --git a/bsc-plugin/src/lib/rooibos/TestSuiteBuilder.ts b/bsc-plugin/src/lib/rooibos/TestSuiteBuilder.ts index 5ea9ae5..1c55e9a 100644 --- a/bsc-plugin/src/lib/rooibos/TestSuiteBuilder.ts +++ b/bsc-plugin/src/lib/rooibos/TestSuiteBuilder.ts @@ -2,9 +2,11 @@ import type { BrsFile, ClassStatement, + FunctionStatement, MethodStatement } from 'brighterscript'; import { + isFunctionStatement, isMethodStatement, util } from 'brighterscript'; @@ -203,7 +205,7 @@ export class TestSuiteBuilder { let sanitizedTestName = this.sanitizeFunctionName(this.currentGroup.name) + '_' + this.sanitizeFunctionName(annotation.name); statement.tokens.name.text = sanitizedTestName; - statement.func.functionStatement.tokens.name.text = sanitizedTestName; + statement.func.findAncestor(isMethodStatement).tokens.name.text = sanitizedTestName; if (numberOfParams > 0) { let index = 0;