Skip to main content



Concierge supports unit testing of Web Modules. Unit test files should be placed in the src/test/jest folder and end with the .test.ts or .test.tsx suffix.

Tests are written in TypeScript using:

Running Tests

Execute the following command in the Web Module folder to run unit tests:

ngv test

This takes care of building or rebuilding Web Module and running unit tests.

Unit Test Structure

The general structure of Jest unit tests:

// Imports

describe('Name of test suite', () => {

    // Setup of constants

    it('test case 1', () => {

    it('test case 2', () => {

Using React Testing Library

Testing component using React Testing Library:

import '@testing-library/jest-dom';
import {render, fireEvent, screen} from '@testing-library/react';

describe('React Testing Library Suite', () => {

    it('test description', () => {
        // Given
        const props = { ... };

        // When
        render(<TestComponent {...props} />);'Load test data'));

        // Then
        expect(screen.getByRole('alert')).toHaveTextContent('Oops, failed to fetch!');


An example of unit tests with comments can be found in sample.