diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cfa159a..4f65534 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,7 +39,7 @@ jobs: with: node-version: "16.20.2" architecture: 'x64' # fix for macos-latest - - run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ./.npmrc + - run: cd bsc-plugin && echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ./.npmrc - run: cd bsc-plugin && npm ci - run: cd bsc-plugin && npm run build #create npm package diff --git a/bsc-plugin/CHANGELOG.md b/bsc-plugin/CHANGELOG.md index 4ca7f13..48d67a9 100644 --- a/bsc-plugin/CHANGELOG.md +++ b/bsc-plugin/CHANGELOG.md @@ -1,19 +1,46 @@ -### Changelog +# Changelog +All notable changes to this project will be documented in this file. -All notable changes to this project will be documented in this file. Dates are displayed in UTC. +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). + + +## [6.0.0-alpha.38](https://github.com/rokucommunity/brighterscript/compare/5.13.0...v6.0.0-alpha.38) - 2024-10-01 +### Changed + - upgrade to brighterscript v1.0.0-alpha.38 and fix issues ([#299](https://github.com/rokucommunity/rooibos/pull/299)) + - this changelog now adopts the standard format from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) + - the versioning for the 6.0.0 alphas will align with the version of brighterscript v1 alpha that it supports. + + + +#### [5.13.0](https://github.com/rokucommunity/rooibos/compare/5.12.0...5.13.0) + +- chore(deps): bump luxon from 1.28.0 to 1.28.1 [`#210`](https://github.com/rokucommunity/rooibos/pull/210) +- Fixed a bug where scope validations where incomplete for node tests [`#280`](https://github.com/rokucommunity/rooibos/pull/280) +- Changes for the migration of this repo to RokuCommunity org [`#286`](https://github.com/rokucommunity/rooibos/pull/286) +- Use an AA to index test suites [`#287`](https://github.com/rokucommunity/rooibos/pull/287) +- Bugfix/general fixes [`#284`](https://github.com/rokucommunity/rooibos/pull/284) +- addresses regression that prevents stubCall allowing non-function return values [`#283`](https://github.com/rokucommunity/rooibos/pull/283) +- Updated to node 16.20.2 [`#285`](https://github.com/rokucommunity/rooibos/pull/285) +- Allow custom test reporter [`#265`](https://github.com/rokucommunity/rooibos/pull/265) +- Fixed logs sometimes getting cut off at the end of running tests [`#279`](https://github.com/rokucommunity/rooibos/pull/279) +- Adjust implementation to fit with new proposal [`599e6ce`](https://github.com/rokucommunity/rooibos/commit/599e6ce0e02bd16f5ca6bc06ab16bb2a7ec8d1e2) +- Switch reporter API to conform to new spec proposal, add `onBegin` and `onEnd` [`54aa936`](https://github.com/rokucommunity/rooibos/commit/54aa936382786b35823406b7d14e9d7a47f8f227) +- Tweak reporter method signature to accept event AA [`c2f0b2f`](https://github.com/rokucommunity/rooibos/commit/c2f0b2fb1ec0e5ebc1dcb164802542636f78499f) #### [5.12.0](https://github.com/rokucommunity/rooibos/compare/5.11.0...5.12.0) +> 10 March 2024 + - Fixed assertAsyncField params [`#278`](https://github.com/rokucommunity/rooibos/pull/278) - Fixed async tests sometimes waiting the full timeout even though the … [`#276`](https://github.com/rokucommunity/rooibos/pull/276) - Lcov fixes [`#274`](https://github.com/rokucommunity/rooibos/pull/274) - Fix SGNode test generation [`#270`](https://github.com/rokucommunity/rooibos/pull/270) - Fixed duplicate cur line injections [`#267`](https://github.com/rokucommunity/rooibos/pull/267) -- Merge pull request #273 from rokucommunity/faster-applcation-closing [`9471f48`](https://github.com/rokucommunity/rooibos/commit/9471f484b267545865671cb79d624e6b2abb4d6c) +- chore: release v5.12.0 [`b47c88e`](https://github.com/rokucommunity/rooibos/commit/b47c88e5af6b5d141a4784847933e59439aaedeb) +- Merge pull request #273 from georgejecook/faster-applcation-closing [`9471f48`](https://github.com/rokucommunity/rooibos/commit/9471f484b267545865671cb79d624e6b2abb4d6c) - Fixed failed tests and upgraded brighterscript [`ffdc3ca`](https://github.com/rokucommunity/rooibos/commit/ffdc3ca5662af46c6586ff3f072ba2ac05080325) -- Added some samples that would result in more then 100 percent covrage before the fix [`82e088e`](https://github.com/rokucommunity/rooibos/commit/82e088e410a8996b1084e64c66d47b4bfc1b9a4f) #### [5.11.0](https://github.com/rokucommunity/rooibos/compare/5.10.0...5.11.0) @@ -669,10 +696,110 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - removes rooibosPreprocessor - it now is in it's own repo [`1477b1e`](https://github.com/rokucommunity/rooibos/commit/1477b1e3ee9ae8ec3a9ec9de9167a51308b945b0) - bunch of fixes for solo test and solo param filtering, introduces more stub test data to work with (mainly just looking at output right now - needs more asserts) and also better handling of params (deals with bright scripts loose json parser and invalid type, by having direct control of the suite, group and test via asText, as opposed to simply doing asJson and stringily) [`26e1f09`](https://github.com/rokucommunity/rooibos/commit/26e1f092b2c4c6050fe3d329af424597b643e35c) -#### v0.2 +### [v0.2](https://github.com/rokucommunity/rooibos/compare/v0.0.0-packages...v0.2) > 1 October 2018 +#### v0.0.0-packages + +> 12 June 2024 + +- Updated to node 16.20.2 [`#285`](https://github.com/rokucommunity/rooibos/pull/285) +- Allow custom test reporter [`#265`](https://github.com/rokucommunity/rooibos/pull/265) +- Fixed logs sometimes getting cut off at the end of running tests [`#279`](https://github.com/rokucommunity/rooibos/pull/279) +- Fixed assertAsyncField params [`#278`](https://github.com/rokucommunity/rooibos/pull/278) +- Fixed async tests sometimes waiting the full timeout even though the … [`#276`](https://github.com/rokucommunity/rooibos/pull/276) +- Lcov fixes [`#274`](https://github.com/rokucommunity/rooibos/pull/274) +- Fix SGNode test generation [`#270`](https://github.com/rokucommunity/rooibos/pull/270) +- Fixed duplicate cur line injections [`#267`](https://github.com/rokucommunity/rooibos/pull/267) +- Code cov perf and bug fix in if statements [`#264`](https://github.com/rokucommunity/rooibos/pull/264) +- Added an api to fail tests with an exception [`#263`](https://github.com/rokucommunity/rooibos/pull/263) +- Reduce raw code statements [`#260`](https://github.com/rokucommunity/rooibos/pull/260) +- Updated annotations to be order agnostic [`#262`](https://github.com/rokucommunity/rooibos/pull/262) +- Feature/runtime global function mocking [`#259`](https://github.com/rokucommunity/rooibos/pull/259) +- Small formatter pass and code change to be formatter frendly [`#252`](https://github.com/rokucommunity/rooibos/pull/252) +- Updated default global excluded files [`#251`](https://github.com/rokucommunity/rooibos/pull/251) +- Fix Rooibos_init injection causing duplicate calls [`#247`](https://github.com/rokucommunity/rooibos/pull/247) +- Fix some sourcemap transpile issues [`#249`](https://github.com/rokucommunity/rooibos/pull/249) +- Added a config value to crash when a assert fails [`#248`](https://github.com/rokucommunity/rooibos/pull/248) +- Update FileFactory.ts to move status labels down for better visibility [`#245`](https://github.com/rokucommunity/rooibos/pull/245) +- fixes failing test [`#246`](https://github.com/rokucommunity/rooibos/pull/246) +- Junit test reporter [`#243`](https://github.com/rokucommunity/rooibos/pull/243) +- Chore/doc update [`#244`](https://github.com/rokucommunity/rooibos/pull/244) +- WIP: adds support for expecting on global functions and namespace functions [`#241`](https://github.com/rokucommunity/rooibos/pull/241) +- added docs about rendezvous tracking config flag [`#242`](https://github.com/rokucommunity/rooibos/pull/242) +- fix spelling [`#239`](https://github.com/rokucommunity/rooibos/pull/239) +- fixes docs issue [`#238`](https://github.com/rokucommunity/rooibos/pull/238) +- feat(core): add support for declaring tests as functions. Resolves #235 [`#236`](https://github.com/rokucommunity/rooibos/pull/236) +- Proposed fix for anonymous callback crash [`#234`](https://github.com/rokucommunity/rooibos/pull/234) +- fix: fixes crash when merging groups in a node test [`#233`](https://github.com/rokucommunity/rooibos/pull/233) +- Fix coverage files import [`#232`](https://github.com/rokucommunity/rooibos/pull/232) +- Adds release-it-stuff [`#231`](https://github.com/rokucommunity/rooibos/pull/231) +- docs: adds documentation for code coverage [`#230`](https://github.com/rokucommunity/rooibos/pull/230) +- Fix code coverage [`#209`](https://github.com/rokucommunity/rooibos/pull/209) +- fix(runner): addresses crash on tests-scene [`#229`](https://github.com/rokucommunity/rooibos/pull/229) +- Feat/custom test scene [`#225`](https://github.com/rokucommunity/rooibos/pull/225) +- Fix/compiler issues [`#224`](https://github.com/rokucommunity/rooibos/pull/224) +- Feat/async testing [`#223`](https://github.com/rokucommunity/rooibos/pull/223) +- [FLAG] Adds keepAppOpen flag [`#212`](https://github.com/rokucommunity/rooibos/pull/212) +- Fix build badge and fix readme formatting [`#218`](https://github.com/rokucommunity/rooibos/pull/218) +- Fix CI by NOT excluding package-lock [`#219`](https://github.com/rokucommunity/rooibos/pull/219) +- Fix/dont iteate m or top, dont loop too many times [`#216`](https://github.com/rokucommunity/rooibos/pull/216) +- Fix/crash stagingdir [`#215`](https://github.com/rokucommunity/rooibos/pull/215) +- Renames global timer var for uniqueness [`#211`](https://github.com/rokucommunity/rooibos/pull/211) +- Fix/add mc node support [`#208`](https://github.com/rokucommunity/rooibos/pull/208) +- fixes issue with creating main.brs file that would cause the entire project to go south [`#207`](https://github.com/rokucommunity/rooibos/pull/207) +- support otherFake with expectedInvocations>1 [`#199`](https://github.com/rokucommunity/rooibos/pull/199) +- Fix windows builds [`#205`](https://github.com/rokucommunity/rooibos/pull/205) +- Fix - Remove "createNodefile" call duplicate [`#194`](https://github.com/rokucommunity/rooibos/pull/194) +- Fix/update to bsc 0.59.0 [`#192`](https://github.com/rokucommunity/rooibos/pull/192) +- Make "undent" a prod dependency [`#186`](https://github.com/rokucommunity/rooibos/pull/186) +- fix(asserts): fixes logic error in assertclass [`#179`](https://github.com/rokucommunity/rooibos/pull/179) +- Feat/allow pointers for assert class [`#178`](https://github.com/rokucommunity/rooibos/pull/178) +- fix(stubs): do not update non-mockable objects, needlessly [`#177`](https://github.com/rokucommunity/rooibos/pull/177) +- feature(stubs): rooibos will now automtically convert any object that requires stubbing into a stubbable object [`#176`](https://github.com/rokucommunity/rooibos/pull/176) +- fix(core): uses lifecycle hooks correctly, so as to not transpile files before enums and other bsc plugin tasks have occurred [`#175`](https://github.com/rokucommunity/rooibos/pull/175) +- Fix/fix incorrect empty message [`#173`](https://github.com/rokucommunity/rooibos/pull/173) +- fix(core): fixes incorrect class name equality checks [`#172`](https://github.com/rokucommunity/rooibos/pull/172) +- fix(asserts): improves like,and imrpoves output for types, across the board [`#171`](https://github.com/rokucommunity/rooibos/pull/171) +- Use AstEditor for all transpile modifications [`#159`](https://github.com/rokucommunity/rooibos/pull/159) +- Feat/update to bsc 0.49.0 [`#167`](https://github.com/rokucommunity/rooibos/pull/167) +- adds expectLastCallToThrowError so we can throw errors from fakes [`#166`](https://github.com/rokucommunity/rooibos/pull/166) +- Quality of life fixes [`#162`](https://github.com/rokucommunity/rooibos/pull/162) +- Feature/accept expect once with function param [`#157`](https://github.com/rokucommunity/rooibos/pull/157) +- adds callfunc once method [`#156`](https://github.com/rokucommunity/rooibos/pull/156) +- Update slack link [`#155`](https://github.com/rokucommunity/rooibos/pull/155) +- chore: update to bsc 0.45.3 [`#152`](https://github.com/rokucommunity/rooibos/pull/152) +- fix(node-tests): fixes node tests not running [`#147`](https://github.com/rokucommunity/rooibos/pull/147) +- fix: fixes equals failures [`#144`](https://github.com/rokucommunity/rooibos/pull/144) +- improves stringand float comparisons and assert not invalid message [`#142`](https://github.com/rokucommunity/rooibos/pull/142) +- Feat/add home press flag [`#140`](https://github.com/rokucommunity/rooibos/pull/140) +- Fix/doc improvements [`#139`](https://github.com/rokucommunity/rooibos/pull/139) +- Fix/doc improvements [`#138`](https://github.com/rokucommunity/rooibos/pull/138) +- Feat/adds flag to allow skipping some fields on iterative equals [`#135`](https://github.com/rokucommunity/rooibos/pull/135) +- Clutch of fixes [`#134`](https://github.com/rokucommunity/rooibos/pull/134) +- chore: fix docs [`#132`](https://github.com/rokucommunity/rooibos/pull/132) +- remove travis [`#130`](https://github.com/rokucommunity/rooibos/pull/130) +- chore: update docs [`#131`](https://github.com/rokucommunity/rooibos/pull/131) +- Beta [`#121`](https://github.com/rokucommunity/rooibos/pull/121) +- feat(framework-tests): Improve framework tests by making it a bsc compiled app, so that it servers of an example of how to use rooibos with bsc [`#114`](https://github.com/rokucommunity/rooibos/pull/114) +- Chore/move to new bs compiler [`#106`](https://github.com/rokucommunity/rooibos/pull/106) +- Feature/option to remove test times [`#82`](https://github.com/rokucommunity/rooibos/pull/82) +- add option to not print test times [`#80`](https://github.com/rokucommunity/rooibos/pull/80) +- feat: Increase mocks limit to 25 - it is now possible to create up to 25 mocks for a given test suite. [`#73`](https://github.com/rokucommunity/rooibos/pull/73) +- fixes compatability issues with rooibos cli [`#68`](https://github.com/rokucommunity/rooibos/pull/68) +- Feature/check version [`#66`](https://github.com/rokucommunity/rooibos/pull/66) +- adds legacy support [`#61`](https://github.com/rokucommunity/rooibos/pull/61) +- Feature/move json config [`#54`](https://github.com/rokucommunity/rooibos/pull/54) +- Feature/code coverage [`#46`](https://github.com/rokucommunity/rooibos/pull/46) +- Feature/update to use latest rooibos c [`#41`](https://github.com/rokucommunity/rooibos/pull/41) +- Bugfix/overloaded expects collide on same method name on different objects [`#39`](https://github.com/rokucommunity/rooibos/pull/39) +- Bugfix/minor issues [`#35`](https://github.com/rokucommunity/rooibos/pull/35) +- Feature/multi expect [`#34`](https://github.com/rokucommunity/rooibos/pull/34) +- Bugfix/documentation samples restructuring [`#32`](https://github.com/rokucommunity/rooibos/pull/32) +- Rooibos 2.0.0 [`#26`](https://github.com/rokucommunity/rooibos/pull/26) +- feat(core): add support for declaring tests as functions. Resolves #235 (#236) [`#235`](https://github.com/rokucommunity/rooibos/issues/235) +- fix #45 [`#45`](https://github.com/rokucommunity/rooibos/issues/45) - fixes #5 checking for test naming collisions needs improvements with Params tests - can lead to vague error messages for params [`#5`](https://github.com/rokucommunity/rooibos/issues/5) - fixes #13 aftereach not running [`#13`](https://github.com/rokucommunity/rooibos/issues/13) - fixes #15 [`#15`](https://github.com/rokucommunity/rooibos/issues/15) @@ -680,5 +807,5 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - - fixes #7 - all annotations are now case insensitive [`#7`](https://github.com/rokucommunity/rooibos/issues/7) - fixes #9 Typo [`#9`](https://github.com/rokucommunity/rooibos/issues/9) - -remove unused api docs folder [`6af014d`](https://github.com/rokucommunity/rooibos/commit/6af014d8d9352158739d36232e874ca26100b04d) -- - api docs in docs folder now [`66f50b9`](https://github.com/rokucommunity/rooibos/commit/66f50b9e8cf0c7804ae3befe09c0880c8bf9c1da) -- Initial commit [`39969ee`](https://github.com/rokucommunity/rooibos/commit/39969ee6760a610bf35b150b5f5b2eacb6be84c0) +- Adjust implementation to fit with new proposal [`599e6ce`](https://github.com/rokucommunity/rooibos/commit/599e6ce0e02bd16f5ca6bc06ab16bb2a7ec8d1e2) +- Fixed failed tests and upgraded brighterscript [`ffdc3ca`](https://github.com/rokucommunity/rooibos/commit/ffdc3ca5662af46c6586ff3f072ba2ac05080325) diff --git a/bsc-plugin/package-lock.json b/bsc-plugin/package-lock.json index 020bf27..37a6d15 100644 --- a/bsc-plugin/package-lock.json +++ b/bsc-plugin/package-lock.json @@ -1,12 +1,12 @@ { "name": "rooibos-roku", - "version": "6.0.0-alpha.1", + "version": "6.0.0-alpha.38", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "rooibos-roku", - "version": "6.0.0-alpha.1", + "version": "6.0.0-alpha.38", "license": "ISC", "dependencies": { "roku-debug": "^0.21.10", @@ -26,7 +26,7 @@ "@types/yargs": "^15.0.5", "@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", @@ -1958,9 +1958,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", @@ -5788,9 +5788,10 @@ } }, "node_modules/micromatch": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", - "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", + "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.3", "picomatch": "^2.3.1" @@ -11316,9 +11317,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", @@ -14147,9 +14148,10 @@ "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==" }, "micromatch": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", - "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", + "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.3", "picomatch": "^2.3.1" diff --git a/bsc-plugin/package.json b/bsc-plugin/package.json index ad426ff..5c9cded 100644 --- a/bsc-plugin/package.json +++ b/bsc-plugin/package.json @@ -1,6 +1,6 @@ { "name": "rooibos-roku", - "version": "6.0.0-alpha.1", + "version": "6.0.0-alpha.38", "description": "simple, flexible, fun brightscript test framework for roku scenegraph apps - roku brighterscript plugin", "scripts": { "preversion": "npm run build && npm run lint && npm run test", @@ -49,7 +49,7 @@ "@types/yargs": "^15.0.5", "@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; diff --git a/package-lock.json b/package-lock.json index 889199f..92f75c0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { - "name": "rooibos", - "version": "1.0.0", + "name": "rooibos-roku", + "version": "6.0.0-alpha.1", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "rooibos", - "version": "1.0.0", + "name": "rooibos-roku", + "version": "6.0.0-alpha.1", "hasInstallScript": true, "license": "MIT", "devDependencies": { diff --git a/package.json b/package.json index 58a70a6..53a66b4 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "rooibos", + "name": "rooibos-roku", "version": "6.0.0-alpha.1", "description": "simple, flexible, fun brightscript test framework for roku scenegraph apps", "scripts": {