From bc5a55fee03fad2a19a38f6aa3a56883ee4704e5 Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Sat, 10 Feb 2024 13:34:53 -0800 Subject: [PATCH] tests: Get all tests running with ESM. (#197) * Get tests working. * Update snapshots. * Get working. * Update snapshots. * Polish. * Fixes. * Move mock. * Fix mock. * Update snapshots. * Fix windows test. * Enable moonbase. * Fix test. --- .github/workflows/build.yml | 3 + .github/workflows/deploy.yml | 5 +- .github/workflows/pr.yml | 2 - .moon/tasks.yml | 20 +- babel.config.js | 14 - jest.config.js | 34 -- package.json | 7 +- packages/cli/__mocks__/term-size.js | 7 + packages/cli/tests/LogBuffer.test.ts | 2 +- packages/cli/tests/__mocks__/term-size.js | 3 - .../tests/__snapshots__/Failure.test.tsx.snap | 18 +- .../tests/__snapshots__/Header.test.tsx.snap | 12 +- .../tests/__snapshots__/Help.test.tsx.snap | 32 +- .../__snapshots__/IndexHelp.test.tsx.snap | 14 +- .../tests/__snapshots__/Program.test.tsx.snap | 116 +++--- .../tests/__snapshots__/Style.test.tsx.snap | 40 +-- .../__snapshots__/Confirm.test.tsx.snap | 16 +- .../__snapshots__/HiddenInput.test.tsx.snap | 10 +- .../__snapshots__/Input.test.tsx.snap | 38 +- .../__snapshots__/MultiSelect.test.tsx.snap | 40 +-- .../__snapshots__/PasswordInput.test.tsx.snap | 10 +- .../__snapshots__/Select.test.tsx.snap | 60 ++-- .../__snapshots__/Cursor.test.tsx.snap | 14 +- .../__snapshots__/Label.test.tsx.snap | 6 +- .../__snapshots__/Prompt.test.tsx.snap | 16 +- .../ScrollableList.test.tsx.snap | 24 +- .../__snapshots__/useProgram.test.tsx.snap | 4 +- packages/common/package.json | 2 +- packages/common/src/PathResolver.ts | 9 +- packages/common/tests/PathResolver.test.ts | 8 +- .../tests/__snapshots__/Contract.test.ts.snap | 34 +- .../__snapshots__/deepFreeze.test.ts.snap | 2 - packages/config/tests/IgnoreFinder.test.ts | 5 +- .../__snapshots__/ConfigFinder.test.ts.snap | 8 +- .../__snapshots__/IgnoreFinder.test.ts.snap | 8 +- .../__snapshots__/Processor.test.ts.snap | 38 +- packages/debug/tests/CrashReporter.test.ts | 7 +- .../__snapshots__/CrashReporter.test.ts.snap | 18 +- packages/decorators/moon.yml | 4 + packages/decorators/src/Deprecate.ts | 4 +- .../tests/__snapshots__/Bind.test.ts.snap | 5 - .../tests/__snapshots__/Debounce.test.ts.snap | 5 - .../tests/__snapshots__/Memoize.test.ts.snap | 13 - .../tests/__snapshots__/Throttle.test.ts.snap | 5 - .../__snapshots__/BaseEvent.test.ts.snap | 10 +- .../tests/transports/FileTransport.test.ts | 2 +- packages/module/moon.yml | 4 + packages/module/tests/requireModule.test.ts | 2 +- packages/pipeline/package.json | 2 +- packages/pipeline/src/Pipeline.ts | 2 +- packages/pipeline/src/Routine.ts | 2 +- .../tests/__snapshots__/Routine.test.ts.snap | 6 +- .../tests/__snapshots__/WorkUnit.test.ts.snap | 8 +- packages/plugin/package.json | 3 +- packages/plugin/src/Loader.ts | 5 +- packages/plugin/src/Registry.ts | 3 +- packages/terminal/moon.yml | 3 + packages/test-utils/README.md | 4 +- packages/test-utils/moon.yml | 3 + packages/test-utils/src/fixtures.ts | 28 +- .../translate/tests/LocaleDetector.test.ts | 4 +- .../createTranslator.test.ts.snap | 8 +- .../config-extends-fs-paths/.config/boost.js | 2 +- .../__fixtures__/i18n-resources/package.json | 4 + .../{index.js => index.mjs} | 4 +- tests/setup.ts | 34 +- tsconfig.eslint.json | 5 +- types/global.d.ts | 8 +- types/vitest.d.ts | 10 + vitest.config.ts | 13 +- website/docs/migrate/5.0.md | 29 ++ website/sidebars.js | 2 +- yarn.lock | 339 +++++++++--------- 73 files changed, 656 insertions(+), 635 deletions(-) delete mode 100644 babel.config.js delete mode 100644 jest.config.js create mode 100644 packages/cli/__mocks__/term-size.js delete mode 100644 packages/cli/tests/__mocks__/term-size.js create mode 100644 packages/decorators/moon.yml delete mode 100644 packages/decorators/tests/__snapshots__/Bind.test.ts.snap delete mode 100644 packages/decorators/tests/__snapshots__/Debounce.test.ts.snap delete mode 100644 packages/decorators/tests/__snapshots__/Memoize.test.ts.snap delete mode 100644 packages/decorators/tests/__snapshots__/Throttle.test.ts.snap create mode 100644 packages/terminal/moon.yml create mode 100644 packages/test-utils/moon.yml create mode 100644 tests/__fixtures__/i18n-resources/package.json rename tests/__fixtures__/plugin-renderer-class/{index.js => index.mjs} (66%) create mode 100644 types/vitest.d.ts create mode 100644 website/docs/migrate/5.0.md diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 55af6cdd6..9d253e3e7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,6 +22,7 @@ jobs: auto-install: true - run: moon ci --color env: + MOONBASE_SECRET_KEY: ${{ secrets.MOONBASE_SECRET_KEY }} MOON_NODE_VERSION: ${{ matrix.node-version }} pack: name: Pack @@ -34,6 +35,8 @@ jobs: with: auto-install: true - run: 'moon run :pack --color' + env: + MOONBASE_SECRET_KEY: ${{ secrets.MOONBASE_SECRET_KEY }} # docs: # name: Docs # runs-on: ubuntu-latest diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d586f1534..805b3ef4e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -10,8 +10,6 @@ jobs: steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 - with: - cache: yarn - name: Add key to allow access to repository env: SSH_AUTH_SOCK: /tmp/ssh_agent.sock @@ -32,7 +30,6 @@ jobs: run: | git config --global user.email "actions@github.com" git config --global user.name "gh-actions" - yarn install --immutable - yarn run pack + yarn run moon run :pack cd website yarn run deploy diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 5b3d4a7c8..6fccfadfd 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -7,8 +7,6 @@ jobs: steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 - with: - cache: yarn - uses: beemojs/conventional-pr-action@v2 with: require-multiple-commits: false diff --git a/.moon/tasks.yml b/.moon/tasks.yml index 59016549b..4aac83ada 100644 --- a/.moon/tasks.yml +++ b/.moon/tasks.yml @@ -15,7 +15,9 @@ tasks: shell: true build: - command: 'packemon build --addEngines' + command: 'packemon build --addEngines --quiet' + deps: + - '^:build' inputs: - '@group(sources)' - 'package.json' @@ -68,6 +70,22 @@ tasks: args: '--write' local: true + test: + command: 'vitest run --config @in(0) .' + inputs: + - '/vitest.config.ts' + - '@group(sources)' + - '@group(tests)' + deps: + - 'build' + env: + BOOSTJS_ENV: 'test' + + test-cov: + extends: 'test' + args: '--coverage' + local: true + typecheck: command: 'tsc --build' inputs: diff --git a/babel.config.js b/babel.config.js deleted file mode 100644 index 812a1edd9..000000000 --- a/babel.config.js +++ /dev/null @@ -1,14 +0,0 @@ -module.exports = { - babelrc: true, - babelrcRoots: ['packages/*', 'themes/*', 'website'], - comments: false, - presets: [ - [ - 'moon', - { - decorators: true, - react: true, - }, - ], - ], -}; diff --git a/jest.config.js b/jest.config.js deleted file mode 100644 index dec660925..000000000 --- a/jest.config.js +++ /dev/null @@ -1,34 +0,0 @@ -module.exports = { - preset: 'jest-preset-moon', - coveragePathIgnorePatterns: [ - '__fixtures__', - 'src/test.ts', - // Annoying to test - 'cli/src/hooks', - // Impossible to test - 'common/src/helpers/requireTypedModule.ts', - 'cli/src/middleware/checkNodeRequirement.ts', - 'cli/src/LogWriter.tsx', - 'cli/src/Wrapper.tsx', - // Not supported by Jest/Babel - 'config/src/loaders/mjs.ts', - 'config/src/loaders/ts.ts', - 'config/src/loaders/supports', - 'decorators/src/helpers/isParam.ts', - // Ignore these packages - 'internal/src', - 'module', - 'terminal/src', - 'test-utils/src', - 'website/src', - ], - coverageThreshold: { - global: { - branches: 90, - functions: 99, - lines: 99, - statements: 99, - }, - }, - testPathIgnorePatterns: ['src/test.ts'], -}; diff --git a/package.json b/package.json index 216b62b26..7ebd3cd79 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,6 @@ "moon": "$(yarn bin moon) --color", "coverage": "yarn test --coverage", "docs": "cd website && yarn run start", - "test": "NODE_ENV=test BOOSTJS_ENV=test vitest", "release": "yarn run pack && yarn run check && lerna-release", "version": "yarn install && git add yarn.lock", "packemon": "yarn dlx --package packemon@3.3.1 --package typescript --quiet packemon" @@ -15,19 +14,17 @@ "node": "20.11.0" }, "devDependencies": { - "@babel/core": "^7.23.9", "@moonrepo/cli": "^1.21.3", "@moonrepo/dev": "^2.0.1", - "@types/babel__core": "^7.20.5", "@types/exit": "^0.1.31", "@types/fs-extra": "^11.0.1", - "@types/lodash": "^4.14.194", + "@types/lodash-es": "^4.17.12", "@types/pluralize": "^0.0.29", "@types/react": "^17.0.58", "@types/semver": "^7.3.13", "@types/split": "^1.0.2", "@types/wrap-ansi": "^3.0.0", - "babel-preset-moon": "^2.0.14", + "@vitest/coverage-v8": "^1.2.2", "eslint": "^8.56.0", "eslint-config-moon": "^2.1.1", "fs-extra": "^11.1.1", diff --git a/packages/cli/__mocks__/term-size.js b/packages/cli/__mocks__/term-size.js new file mode 100644 index 000000000..c6fb46ab1 --- /dev/null +++ b/packages/cli/__mocks__/term-size.js @@ -0,0 +1,7 @@ +function size() { + return { columns: 80, rows: 80 }; +} + +size.size = size; + +module.exports = size; diff --git a/packages/cli/tests/LogBuffer.test.ts b/packages/cli/tests/LogBuffer.test.ts index 0e2a1a18e..8524fb6dd 100644 --- a/packages/cli/tests/LogBuffer.test.ts +++ b/packages/cli/tests/LogBuffer.test.ts @@ -1,4 +1,4 @@ -import { describe, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; import { LogBuffer } from '../src/LogBuffer'; describe('LogBuffer', () => { diff --git a/packages/cli/tests/__mocks__/term-size.js b/packages/cli/tests/__mocks__/term-size.js deleted file mode 100644 index 91477a62a..000000000 --- a/packages/cli/tests/__mocks__/term-size.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function size() { - return { columns: 80, rows: 80 }; -}; diff --git a/packages/cli/tests/__snapshots__/Failure.test.tsx.snap b/packages/cli/tests/__snapshots__/Failure.test.tsx.snap index 214d3f9da..dda8c6d25 100644 --- a/packages/cli/tests/__snapshots__/Failure.test.tsx.snap +++ b/packages/cli/tests/__snapshots__/Failure.test.tsx.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[` doesnt render code frame if a common error 1`] = ` +exports[` > doesnt render code frame if a common error 1`] = ` "  ERROR  @@ -8,7 +8,7 @@ exports[` doesnt render code frame if a common error 1`] = ` " `; -exports[` doesnt render code frame if arg not found 1`] = ` +exports[` > doesnt render code frame if arg not found 1`] = ` "  ERROR  @@ -16,7 +16,7 @@ exports[` doesnt render code frame if arg not found 1`] = ` " `; -exports[` reduces command line by half when index appears off screen 1`] = ` +exports[` > reduces command line by half when index appears off screen 1`] = ` " ERROR @@ -27,7 +27,7 @@ exports[` reduces command line by half when index appears off screen " `; -exports[` renders a common error 1`] = ` +exports[` > renders a common error 1`] = ` "  ERROR  @@ -35,7 +35,7 @@ exports[` renders a common error 1`] = ` " `; -exports[` renders a parse error 1`] = ` +exports[` > renders a parse error 1`] = ` "  ERROR  @@ -43,7 +43,7 @@ exports[` renders a parse error 1`] = ` " `; -exports[` renders a parse error with a command line 1`] = ` +exports[` > renders a parse error with a command line 1`] = ` " ERROR @@ -54,7 +54,7 @@ exports[` renders a parse error with a command line 1`] = ` " `; -exports[` renders a validation error 1`] = ` +exports[` > renders a validation error 1`] = ` "  ERROR  @@ -62,7 +62,7 @@ exports[` renders a validation error 1`] = ` " `; -exports[` renders a validation error with a command line 1`] = ` +exports[` > renders a validation error with a command line 1`] = ` " ERROR diff --git a/packages/cli/tests/__snapshots__/Header.test.tsx.snap b/packages/cli/tests/__snapshots__/Header.test.tsx.snap index ef83d96ef..7f01c15a2 100644 --- a/packages/cli/tests/__snapshots__/Header.test.tsx.snap +++ b/packages/cli/tests/__snapshots__/Header.test.tsx.snap @@ -1,30 +1,30 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`
renders \`default\` 1`] = ` +exports[`
> renders \`default\` 1`] = ` "  TITLE  " `; -exports[`
renders \`failure\` 1`] = ` +exports[`
> renders \`failure\` 1`] = ` "  TITLE  " `; -exports[`
renders \`muted\` 1`] = ` +exports[`
> renders \`muted\` 1`] = ` "  TITLE  " `; -exports[`
renders \`success\` 1`] = ` +exports[`
> renders \`success\` 1`] = ` "  TITLE  " `; -exports[`
renders \`warning\` 1`] = ` +exports[`
> renders \`warning\` 1`] = ` "  TITLE  " diff --git a/packages/cli/tests/__snapshots__/Help.test.tsx.snap b/packages/cli/tests/__snapshots__/Help.test.tsx.snap index 57d56d967..b2d791f0b 100644 --- a/packages/cli/tests/__snapshots__/Help.test.tsx.snap +++ b/packages/cli/tests/__snapshots__/Help.test.tsx.snap @@ -1,8 +1,8 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[` commands doesnt render empty commands 1`] = `""`; +exports[` > commands > doesnt render empty commands 1`] = `""`; -exports[` commands renders commands (stripped) 1`] = ` +exports[` > commands > renders commands (stripped) 1`] = ` " COMMANDS @@ -10,7 +10,7 @@ exports[` commands renders commands (stripped) 1`] = ` foo src [dst] This is a normal command with params." `; -exports[` commands renders commands 1`] = ` +exports[` > commands > renders commands 1`] = ` "  COMMANDS  @@ -18,18 +18,18 @@ exports[` commands renders commands 1`] = ` foo src [dst] This is a normal command with params." `; -exports[` config renders description 1`] = `" I am a command that does cool things."`; +exports[` > config > renders description 1`] = `" I am a command that does cool things."`; -exports[` config renders description with additional params 1`] = `" I am a command that does cool things. [deprecated]"`; +exports[` > config > renders description with additional params 1`] = `" I am a command that does cool things. [deprecated]"`; -exports[` config renders description with markdown 1`] = ` +exports[` > config > renders description with markdown 1`] = ` " This is the top level command description. All descriptions support markdown like bold, strong, italics, emphasis, and strikethroughs." `; -exports[` options doesnt render empty options 1`] = `""`; +exports[` > options > doesnt render empty options 1`] = `""`; -exports[` options renders options (stripped) 1`] = ` +exports[` > options > renders options (stripped) 1`] = ` " OPTIONS @@ -52,7 +52,7 @@ exports[` options renders options (stripped) 1`] = ` (default: true)" `; -exports[` options renders options 1`] = ` +exports[` > options > renders options 1`] = ` "  OPTIONS  @@ -75,9 +75,9 @@ exports[` options renders options 1`] = ` (default: true)" `; -exports[` params doesnt render empty params 1`] = `""`; +exports[` > params > doesnt render empty params 1`] = `""`; -exports[` params renders params (stripped) 1`] = ` +exports[` > params > renders params (stripped) 1`] = ` " PARAMS @@ -87,7 +87,7 @@ exports[` params renders params (stripped) 1`] = ` 3 boolean And finally a boolean param. [deprecated]" `; -exports[` params renders params 1`] = ` +exports[` > params > renders params 1`] = ` "  PARAMS  @@ -97,7 +97,7 @@ exports[` params renders params 1`] = ` 3 boolean And finally a boolean param. [deprecated]" `; -exports[` renders everything 1`] = ` +exports[` > renders everything 1`] = ` " I am a command that does cool things.  USAGE  @@ -137,7 +137,7 @@ exports[` renders everything 1`] = ` (default: true)" `; -exports[` usage renders usage array 1`] = ` +exports[` > usage > renders usage array 1`] = ` "  USAGE  @@ -145,7 +145,7 @@ exports[` usage renders usage array 1`] = ` $ test --foo -b" `; -exports[` usage renders usage string 1`] = ` +exports[` > usage > renders usage string 1`] = ` "  USAGE  diff --git a/packages/cli/tests/__snapshots__/IndexHelp.test.tsx.snap b/packages/cli/tests/__snapshots__/IndexHelp.test.tsx.snap index 103f8e3b3..762c501a4 100644 --- a/packages/cli/tests/__snapshots__/IndexHelp.test.tsx.snap +++ b/packages/cli/tests/__snapshots__/IndexHelp.test.tsx.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[` renders a banner 1`] = ` +exports[` > renders a banner 1`] = ` " _____ _____ _____ _____ _____ | __ | | | __|_ _| | __ -| | | | |__ | | | @@ -10,7 +10,7 @@ Boost v1.2.3 boost " `; -exports[` renders a footer 1`] = ` +exports[` > renders a footer 1`] = ` " Boost v1.2.3 boost @@ -18,7 +18,7 @@ Powered by Boost CLI v1.2.3 " `; -exports[` renders a header 1`] = ` +exports[` > renders a header 1`] = ` " Boost v1.2.3 boost @@ -26,7 +26,7 @@ For more information, see https://github.com/milesj/boost " `; -exports[` renders children 1`] = ` +exports[` > renders children 1`] = ` " Boost v1.2.3 boost @@ -72,13 +72,13 @@ Boost v1.2.3 boost " `; -exports[` renders with base props 1`] = ` +exports[` > renders with base props 1`] = ` " Boost v1.2.3 boost " `; -exports[` renders with everything 1`] = ` +exports[` > renders with everything 1`] = ` " _____ _____ _____ _____ _____ | __ | | | __|_ _| | __ -| | | | |__ | | | diff --git a/packages/cli/tests/__snapshots__/Program.test.tsx.snap b/packages/cli/tests/__snapshots__/Program.test.tsx.snap index f8a053a58..8b6dc0a4b 100644 --- a/packages/cli/tests/__snapshots__/Program.test.tsx.snap +++ b/packages/cli/tests/__snapshots__/Program.test.tsx.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[` categories applies categories to index help 1`] = ` +exports[` > categories > applies categories to index help 1`] = ` " Boost v1.2.3 boost @@ -19,19 +19,19 @@ Boost v1.2.3 boost " `; -exports[` components renders and outputs multiple component renders 1`] = ` +exports[` > components > renders and outputs multiple component renders 1`] = ` "Before -Fooinfo Middle -BarBazerror After +FoolevelInfo Middle +BarBazlevelError After " `; -exports[` default command executes default when no args passed 1`] = ` +exports[` > default command > executes default when no args passed 1`] = ` "Build! " `; -exports[` default command renders commands when no args passed 1`] = ` +exports[` > default command > renders commands when no args passed 1`] = ` " Boost v1.2.3 boost @@ -41,7 +41,7 @@ Boost v1.2.3 boost " `; -exports[` error renders a thrown error 1`] = ` +exports[` > error > renders a thrown error 1`] = ` "  ERROR  @@ -49,17 +49,17 @@ exports[` error renders a thrown error 1`] = ` " `; -exports[` errors for invalid version format 1`] = ` -"The following validations have failed for \`Program\`: - - Invalid field "version". String does not match. (pattern "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$")" +exports[` > errors for invalid version format 1`] = ` +[OptimalError: The following validations have failed for \`Program\`: + - Invalid field "version". String does not match. (pattern "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$")] `; -exports[` errors if bin is not kebab case 1`] = ` -"The following validations have failed for \`Program\`: - - Invalid field "bin". String must be in kebab case. (pattern "^[a-z][a-z0-9-]+$")" +exports[` > errors if bin is not kebab case 1`] = ` +[OptimalError: The following validations have failed for \`Program\`: + - Invalid field "bin". String must be in kebab case. (pattern "^[a-z][a-z0-9-]+$")] `; -exports[` exit renders a non-zero exit 1`] = ` +exports[` > exit > renders a non-zero exit 1`] = ` "  ERROR  @@ -67,16 +67,16 @@ exports[` exit renders a non-zero exit 1`] = ` " `; -exports[` exit renders a non-zero exit with component 1`] = `"Content"`; +exports[` > exit > renders a non-zero exit with component 1`] = `"Content"`; -exports[` exit renders a zero exit 1`] = ` +exports[` > exit > renders a zero exit 1`] = ` "Before " `; -exports[` exit renders a zero exit with a component 1`] = `"Content"`; +exports[` > exit > renders a zero exit with a component 1`] = `"Content"`; -exports[` failure renders if an error is thrown 1`] = ` +exports[` > failure > renders if an error is thrown 1`] = ` "  ERROR  @@ -84,7 +84,7 @@ exports[` failure renders if an error is thrown 1`] = ` " `; -exports[` failure renders when args parsing fails 1`] = ` +exports[` > failure > renders when args parsing fails 1`] = ` "  ERROR  @@ -95,7 +95,7 @@ exports[` failure renders when args parsing fails 1`] = ` " `; -exports[` failure renders when invalid command name passed 1`] = ` +exports[` > failure > renders when invalid command name passed 1`] = ` "  ERROR  @@ -103,7 +103,7 @@ exports[` failure renders when invalid command name passed 1`] = ` " `; -exports[` failure renders when misspelt command name passed 1`] = ` +exports[` > failure > renders when misspelt command name passed 1`] = ` "  ERROR  @@ -111,7 +111,7 @@ exports[` failure renders when misspelt command name passed 1`] = ` " `; -exports[` failure renders when no commands could be found 1`] = ` +exports[` > failure > renders when no commands could be found 1`] = ` "  ERROR  @@ -119,7 +119,7 @@ exports[` failure renders when no commands could be found 1`] = ` " `; -exports[` failure renders when no commands have been registered 1`] = ` +exports[` > failure > renders when no commands have been registered 1`] = ` "  ERROR  @@ -128,7 +128,7 @@ exports[` failure renders when no commands have been registered 1`] = " `; -exports[` failure renders with custom exit error 1`] = ` +exports[` > failure > renders with custom exit error 1`] = ` "  ERROR  @@ -136,7 +136,7 @@ exports[` failure renders with custom exit error 1`] = ` " `; -exports[` help outputs help for a nested sub-command 1`] = ` +exports[` > help > outputs help for a nested sub-command 1`] = ` "  CLIENT:BUILD  @@ -157,7 +157,7 @@ exports[` help outputs help for a nested sub-command 1`] = ` -v, --version Display version number" `; -exports[` help outputs help for a nested sub-command 2`] = ` +exports[` > help > outputs help for a nested sub-command 2`] = ` "  CLIENT:INSTALL  @@ -179,7 +179,7 @@ exports[` help outputs help for a nested sub-command 2`] = ` -v, --version Display version number" `; -exports[` help outputs help for a nested sub-command 3`] = ` +exports[` > help > outputs help for a nested sub-command 3`] = ` "  CLIENT  @@ -204,7 +204,7 @@ exports[` help outputs help for a nested sub-command 3`] = ` -v, --version Display version number" `; -exports[` help outputs help for a specific command 1`] = ` +exports[` > help > outputs help for a specific command 1`] = ` "  BUILD  @@ -225,7 +225,7 @@ exports[` help outputs help for a specific command 1`] = ` -v, --version Display version number" `; -exports[` help outputs help for a specific command 2`] = ` +exports[` > help > outputs help for a specific command 2`] = ` "  INSTALL  @@ -247,7 +247,7 @@ exports[` help outputs help for a specific command 2`] = ` -v, --version Display version number" `; -exports[` help outputs help for an aliased command 1`] = ` +exports[` > help > outputs help for an aliased command 1`] = ` "  BUILD  @@ -268,7 +268,7 @@ exports[` help outputs help for an aliased command 1`] = ` -v, --version Display version number" `; -exports[` help outputs help for an aliased command 2`] = ` +exports[` > help > outputs help for an aliased command 2`] = ` "  BUILD  @@ -289,7 +289,7 @@ exports[` help outputs help for an aliased command 2`] = ` -v, --version Display version number" `; -exports[` help outputs help when \`--help\` is passed 1`] = ` +exports[` > help > outputs help when \`--help\` is passed 1`] = ` " Boost v1.2.3 boost @@ -336,7 +336,7 @@ Boost v1.2.3 boost " `; -exports[` help outputs help when \`-h\` is passed 1`] = ` +exports[` > help > outputs help when \`-h\` is passed 1`] = ` " Boost v1.2.3 boost @@ -383,7 +383,7 @@ Boost v1.2.3 boost " `; -exports[` locale errors for invalid \`--locale\` 1`] = ` +exports[` > locale > errors for invalid \`--locale\` 1`] = ` "  ERROR  @@ -394,30 +394,30 @@ exports[` locale errors for invalid \`--locale\` 1`] = ` " `; -exports[` logging handles logging when rendering a component 1`] = ` +exports[` > logging > handles logging when rendering a component 1`] = ` "Log -debug Debug -info Info +levelDebug Debug +levelInfo Info Component log -Returned from component!warn Warn -error Error -trace Trace -error Component error +Returned from component!levelWarn Warn +levelError Error +levelTrace Trace +levelError Component error " `; -exports[` logging handles logging when returning a string 1`] = ` +exports[` > logging > handles logging when returning a string 1`] = ` "Log -debug Debug -info Info +levelDebug Debug +levelInfo Info Returned from command! -warn Warn -error Error -trace Trace +levelWarn Warn +levelError Error +levelTrace Trace " `; -exports[` nested programs bubbles up errors 1`] = ` +exports[` > nested programs > bubbles up errors 1`] = ` "  ERROR  @@ -425,7 +425,7 @@ exports[` nested programs bubbles up errors 1`] = ` " `; -exports[` nested programs can run a program within a command 1`] = ` +exports[` > nested programs > can run a program within a command 1`] = ` "Before run Install! After run @@ -433,34 +433,34 @@ Return " `; -exports[` success can return an element that writes with ink 1`] = `"Hello!"`; +exports[` > success > can return an element that writes with ink 1`] = `"Hello!"`; -exports[` tasks can run a task within a task 1`] = ` +exports[` > tasks > can run a task within a task 1`] = ` "Test Hi 2 -error Bye +levelError Bye " `; -exports[` tasks runs a sync task correctly 1`] = ` +exports[` > tasks > runs a sync task correctly 1`] = ` "Hi 15 -error Bye +levelError Bye " `; -exports[` tasks runs an async task correctly 1`] = ` +exports[` > tasks > runs an async task correctly 1`] = ` "bazfooBAR " `; -exports[` version outputs version when \`--version\` is passed 1`] = ` +exports[` > version > outputs version when \`--version\` is passed 1`] = ` "1.2.3 " `; -exports[` version outputs version when \`-v\` is passed 1`] = ` +exports[` > version > outputs version when \`-v\` is passed 1`] = ` "1.2.3 " `; diff --git a/packages/cli/tests/__snapshots__/Style.test.tsx.snap b/packages/cli/tests/__snapshots__/Style.test.tsx.snap index af4846388..65ded552e 100644 --- a/packages/cli/tests/__snapshots__/Style.test.tsx.snap +++ b/packages/cli/tests/__snapshots__/Style.test.tsx.snap @@ -1,39 +1,39 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`