Skip to content

unit-test builder doesn't work with server #30410

Closed
@robertIsaac

Description

@robertIsaac

Command

test

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

in a newly generated v20 app with server side rendering when changing the test runner to vitest as announced in the v20 blog fails to work

Minimal Reproduction

generate a new app using ssr option
run npm i vitest jsdom --save-dev
in angular.json change test to

"test": {
    "builder": "@angular/build:unit-test",
    "options": {
        "tsConfig": "tsconfig.spec.json",
        "buildTarget": "::development",
        "runner": "vitest"
    }
}

Exception or Error

ng test
NOTE: The "unit-test" builder is currently EXPERIMENTAL and not ready for production use.
An unhandled exception occurred: The "server" option is required when "outputMode" is set to "server".
See "/private/var/folders/lt/jrs1vjm137nbc1xvctmzl7v40000gn/T/ng-sJrdPA/angular-errors.log" for further details.

Your Environment

Angular CLI: 20.0.0
Node: 22.14.0
Package Manager: npm 11.4.1
OS: darwin arm64

Angular: 20.0.0
... build, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-server, router, ssr

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.2000.0
@angular-devkit/core         20.0.0
@angular-devkit/schematics   20.0.0
@schematics/angular          20.0.0
rxjs                         7.8.2
typescript                   5.8.3
zone.js                      0.15.1

Anything else relevant?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions