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 →

jest-environment-ui5

A Jest test 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 Jest environment named ui5 that boots UI5 from a local HTML file and emulates the browser with jsdom. It is selected with testEnvironment: "ui5" in jest.config.js, where testEnvironmentOptions take the HTML file's path and the UI5 load timeout (default 100 ms), or per test file with a @jest-environment ui5 docblock. It covers unit tests that run in jsdom and does not drive a real browser. The Vitest counterpart by the same author is vitest-environment-ui5.

Facts

Latestv0.2.4ReleasedLast 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 jest-environment-ui5

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

README

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

jest-environment-ui5

npm test

A Jest Test 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 Jest Test Environment and jsdom for more details.

Installation

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

$ npm i -D jest  jest-environment-ui5

Setup

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

jest-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.

jest Configuration
import type {Config} from 'jest';

const config: Config = {
  testEnvironment: "ui5",
  testEnvironmentOptions: {
    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
    },
  },
};
jest DocBlock
/**
 * @jest-environment ui5
 * @jest-environment-options { "path": "test/ui5-unit-test.html" }
 */

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 Jest CLI:

$ jest

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 – Jest

Author

Mauricio Lauffer

License

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

MIT, read

History

Latest

v0.2.4

Fixes 1

Notes
Bug Fixes
  1. v0.2.3

    Features 1, Fixes 1

    Notes
    Features
    Bug Fixes
2downloads per week, npm
Weekly downloads for jest-environment-ui526 complete calendar weeks from 2026-04-20 to 2026-10-18; the latest total is 2.20 Apr – 26 Apr: 227 Apr – 3 May: 04 May – 10 May: 511 May – 17 May: 518 May – 24 May: 425 May – 31 May: 81 Jun – 7 Jun: 68 Jun – 14 Jun: 1015 Jun – 21 Jun: 322 Jun – 28 Jun: 529 Jun – 5 Jul: 36 Jul – 12 Jul: 913 Jul – 19 Jul: 120 Jul – 26 Jul: 527 Jul – 2 Aug: 03 Aug – 9 Aug: 210 Aug – 16 Aug: 617 Aug – 23 Aug: 024 Aug – 30 Aug: 831 Aug – 6 Sept: 47 Sept – 13 Sept: 314 Sept – 20 Sept: 321 Sept – 27 Sept: 128 Sept – 4 Oct: 15 Oct – 11 Oct: 012 Oct – 18 Oct: 2
UI5 testing
  1. ui5-test-runnerCommand line running UI5 QUnit and OPA tests in parallel
  2. ui5-middleware-odata-recorderUI5 middleware recording OData traffic as mock server datasets
  3. openui5-smart-mockserverUI5 MockServer extension generating mock data with Faker.js
  4. vitest-environment-ui5Vitest environment running UI5 unit tests in Node.js
  5. wdio-qunit-serviceWebdriverIO service running QUnit test pages
  6. @openui5/sap.ui.coreFramework core: module loader, MVC runtime, binding, routing, theming
  7. karma-ui5-transpileKarma preprocessor transpiling UI5 sources via ui5-tooling-transpile
  8. ui5-journey-recorderChrome extension generating OPA5 or wdi5 tests from recorded journeys
  9. wdi5-cucumberwdi5 plugin for Cucumber-style BDD tests on Fiori Elements apps
  10. wdi5-fe-selectorswdi5 selectors for locating controls in Fiori Elements apps
  11. wdio-ui5-serviceEnd-to-end testing for UI5 on WebdriverIO with UI5 control selectors
  12. @ui5/middleware-code-coverageUI5 CLI middleware for Istanbul code coverage
  13. vscode-ui5-odata-mock-generatorVS Code extension generating OData mock data from service metadata

Details

Sources4
Added by handdiscovered herechecked
npm registry, jest-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.2.4
first release
releases and cadence2
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-jest-environment-ui5
JSON
/artifacts/mauriciolauffer-jest-environment-ui5.json
MCP
Connecting an agent