The purpose of this repo is to demonstrate how to test UI5 Typescript application with Jest framework.
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.
Use npm for dependency management.
Use npm to install the dependencies:
npm installExecute 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 startAs 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.
Execute the following command to test the app:
npm testIn 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.
Execute the following command to build the project and get an app that can be deployed:
npm run buildNote 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.
Do the following to run a TypeScript check:
npm run ts-typecheckThis 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 lintThis project is licensed under the Apache Software License, version 2.0 except as noted otherwise in the LICENSE file.