PackagePackagetypeA library you install and call yourself.See every one →What this type is →independently maintainedindependently maintainedoriginPublished by one person or a small company outside SAP. Says nothing about quality; the readings say that.See every one →

vitest-environment-ui5

A Vitest environment named ui5 that boots UI5 from a local HTML file into jsdom, so UI5 unit tests run in Node.js with no web server and no browser.

UI5 code needs the UI5 runtime in the page before a unit test can touch it, which is why such tests usually run in a browser. This package registers a Vitest environment named ui5 that boots UI5 from a local HTML file you point it at and emulates the browser with jsdom. The environment is selected in vitest.config.js with environmentOptions.ui5, where path names the HTML file holding the UI5 bootstrap and timeout sets the UI5 load time in milliseconds (default 100), or per test file with a docblock. It covers unit tests that run in jsdom and does not drive a real browser.

Facts

Latestv0.3.0ReleasedLast pushLicenceMIT

Where it sits

Lives in
Provides
UI5 testingUI5UI5 testingcapabilityProving a UI still works — unit tests over controllers and formatters, integration tests that drive real controls, and end-to-end runs against a served app.

Who is behind it

Mauricio LaufferMauricio LaufferPersonMaintains this
In the atlas: maintains 16, contributes to 41, wrote 4
@mauriciolauffer
maintainer

What it declares

Every artifact

Type
Package
Origin
Independently maintained
Runtime
Node.js

As a package

Where it runs
does not say
Distributed through
npm

Connections1

Install

npm add vitest-environment-ui5

Derived from the package name. No recipe recorded; the README has the configuration.

README

quoted from mauriciolauffer/vitest-environment-ui5 under MIT, read
mauriciolauffer/vitest-environment-ui5/README.mdOn GitHub

vitest-environment-ui5

npm test

A Vitest Environment for unit testing UI5 code. Run your unit tests in a blazing fast way! Neither webserver nor browser are required. It runs in Node.js and uses jsdom to emulate browser environment.

See Vitest Environment and jsdom for more details.

Installation

Install vitest-environment-ui5, and vitest, as devDependencies:

$ npm i -D vitest  vitest-environment-ui5

Setup

Vitest uses node as default test environment. In order to change it to a different environment, vitest-environment-ui5, we will either have to define it in vitest.config.js or add a @vitest-environment docblock at the top of the test file. See Vitest Config for more details.

vitest-environment-ui5 builds jsdom from a local HTML file, no webserver required. The HTML file should contain the UI5 bootstrap, similar to this one: ui5 bootstrap.

You can change the UI5 bootstrap configuration as you wish, just like in your webapp. You can even open the file in a browser to see UI5 being loaded. However, no tests will be executed.

Vitest Configuration
import { defineConfig } from "vitest/config";

export default defineConfig({
  test: {
    environment: "ui5",
    environmentOptions: {
      ui5: {
        path: "test/ui5-unit-test.html", // Path to the HTML file containing UI5 bootstrap
        timeout: 200, // UI5 load timeout in ms, default is 100ms
      },
    },
  },
});
Vitest DocBlock
/**
 * @vitest-environment ui5
 * @vitest-environment-options { "path": "test/ui5-unit-test.html" }
 */

import { expect, test } from "vitest";

test("UI5 is loaded", () => {
  expect(window.sap).toBeTruthy();
  expect(sap).toBeTruthy();
  expect(sap.ui.getCore()).toBeTruthy();
  expect(sap.ui.version).toBeTruthy();
});

Run

Run the tests with Vitest CLI:

$ vitest

Don't be afraid

jsdom is not a real browser, but gets the job done for unit testing. All major javascript frameworks use it today: React, Vue, Svelte, and even our old friend jQuery. It has over 20M weekly downloads in NPM!

This package simplifies what was introduced in the blog post Modern JavaScript testing frameworks with Fiori/UI5 – Vitest

Author

Mauricio Lauffer

License

This project is licensed under the MIT License - see the LICENSE file for details.

MIT, read

History

Latest

v0.3.0

Features 1

Notes
Features
  1. v0.2.3

    Fixes 1

    Notes
    Bug Fixes
    • environment-options path is required (#18) (d29fa29)
  2. v0.2.2

    Fixes 1

    Notes
    Bug Fixes
  3. v0.2.1

    Fixes 1

    Notes
    Bug Fixes
  4. v0.2.0

    Features 1

    Notes
    Features
  5. v0.1.1

    Fixes 1

    Notes
    Bug Fixes
  6. v0.1.0

    Features 1, Fixes 1

    Notes
    Features
    Bug Fixes
12downloads per week, npm
Weekly downloads for vitest-environment-ui526 complete calendar weeks from 2026-04-20 to 2026-10-18; the latest total is 12.20 Apr – 26 Apr: 427 Apr – 3 May: 44 May – 10 May: 2011 May – 17 May: 1918 May – 24 May: 1825 May – 31 May: 491 Jun – 7 Jun: 168 Jun – 14 Jun: 2615 Jun – 21 Jun: 4822 Jun – 28 Jun: 1129 Jun – 5 Jul: 216 Jul – 12 Jul: 1713 Jul – 19 Jul: 320 Jul – 26 Jul: 1227 Jul – 2 Aug: 183 Aug – 9 Aug: 1710 Aug – 16 Aug: 1217 Aug – 23 Aug: 724 Aug – 30 Aug: 1631 Aug – 6 Sept: 97 Sept – 13 Sept: 1614 Sept – 20 Sept: 1121 Sept – 27 Sept: 928 Sept – 4 Oct: 165 Oct – 11 Oct: 912 Oct – 18 Oct: 12
UI5 testing
  1. ui5-test-runnerCommand line running UI5 QUnit and OPA tests in parallelfrom UI5
  2. ui5-middleware-odata-recorderUI5 middleware recording OData traffic as mock server datasetsfrom UI5
  3. jest-environment-ui5Jest environment running UI5 unit tests in Node.jsfrom UI5
  4. openui5-smart-mockserverUI5 MockServer extension generating mock data with Faker.jsfrom UI5
  5. wdio-qunit-serviceWebdriverIO service running QUnit test pagesfrom UI5
  6. @openui5/sap.ui.coreFramework core: module loader, MVC runtime, binding, routing, themingfrom UI5
  7. karma-ui5-transpileKarma preprocessor transpiling UI5 sources via ui5-tooling-transpilefrom UI5
  8. ui5-journey-recorderChrome extension generating OPA5 or wdi5 tests from recorded journeysfrom UI5
  9. wdi5-cucumberwdi5 plugin for Cucumber-style BDD tests on Fiori Elements appsfrom UI5
  10. wdi5-fe-selectorswdi5 selectors for locating controls in Fiori Elements appsfrom UI5
  11. wdio-ui5-serviceEnd-to-end testing for UI5 on WebdriverIO with UI5 control selectorsfrom UI5
  12. @ui5/middleware-code-coverageUI5 CLI middleware for Istanbul code coveragefrom UI5
  13. vscode-ui5-odata-mock-generatorVS Code extension generating OData mock data from service metadatafrom UI5

Details

Sources4
Added by handdiscovered herechecked
npm registry, vitest-environment-ui5version, releases, installschecked
README.mdquoted, and what the entry declareschecked

Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.

Compatibility and provenance
runtimesnode
latestv0.3.0
first release
releases and cadence8, ~42d median
discovered viaAdded by hand
first seen in the atlas
ecosystem and domainui5, developer-experience
History in the atlas1
  1. First seen.
For your agent
Ref
artifact:mauriciolauffer-vitest-environment-ui5
JSON
/artifacts/mauriciolauffer-vitest-environment-ui5.json
MCP
Connecting an agent