Skip to content

whydrae/ui5-jest-showcase

Repository files navigation

UI5 Application ui5.jest.showcase

The purpose of this repo is to demonstrate how to test UI5 Typescript application with Jest framework.

Description

This app demonstrates a TypeScript setup for developing UI5 applications. The central entry point for all information about using TypeScript with UI5 is at https://sap.github.io/ui5-typescript.

The template is inspired by the SAP-samples/ui5-typescript-helloworld project which also contains a detailed step-by-step guide. It explains how this setup is created and how all the bits and pieces fit together.

Requirements

Use npm for dependency management.

Preparation

Use npm to install the dependencies:

npm install

Run the App

Execute the following command to run the app locally for development in watch mode (the browser reloads the app automatically when there are changes in the source code):

npm start

As shown in the terminal after executing this command, the app is then running on http://localhost:8080/index.html. A browser window with this URL should automatically open.

Test the App

Execute the following command to test the app:

npm test

Debug the App

In the browser, you can directly debug the original TypeScript code, which is supplied via sourcemaps (need to be enabled in the browser's developer console if it does not work straight away). If the browser doesn't automatically jump to the TypeScript code when setting breakpoints, use e.g. Ctrl/Cmd + P in Chrome to open the *.ts file you want to debug.

Build the App

Execute the following command to build the project and get an app that can be deployed:

npm run build

Note that index.html still loads the UI5 framework from the relative URL resources/..., which does not physically exist, but is only provided dynamically by the UI5 tooling. So for an actual deployment you should change this URL to either the CDN or your local deployment of UI5.

Check the Code

Do the following to run a TypeScript check:

npm run ts-typecheck

This checks the application code for any type errors (but will also complain in case of fundamental syntax issues which break the parsing).

To lint the TypeScript code, do:

npm run lint

License

This project is licensed under the Apache Software License, version 2.0 except as noted otherwise in the LICENSE file.

About

UI5 Testing with Jest

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors