npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@itwin/rpcinterface-full-stack-tests

v4.10.2

Published

Test the full iTwin.js Core stack (frontend and backend) using standard RPC interfaces

Downloads

3,999

Readme

iTwin.js RPC Interface Integration Tests

Copyright © Bentley Systems, Incorporated. All rights reserved. See LICENSE.md for license terms and full copyright notice.

This package contains the iTwin.js RPC Interface integration tests and configuration setup to run them against a deployed backend.

Prerequisites

Refer to the iTwin.js prerequisites

Running the tests

Before running the tests, the environment needs to be setup. The easiest way is to configure a [.env] file in the working directory, the template.env file has information about how to set one up and all the variables that need to be configured.

All test related settings are contained in the process.env variable and parsed by Settings.ts. If something required is missing or not configured properly, the tests will fail to setup.

Setting up the required context

The tests require an Project and iModel to be setup in order to run properly.

The iModel doesn't require anything special and can be a seed iModel.

Specifying users to be used for testing

The tests require a single user to be specified. The user's access rules required are:

  1. User1 - full access to the Project and an iModel (requires iModelHub Read iModel Project Role)
    • i.e., "user_with_access_username" in the .env file.

Specifying the backend

If the specified address for the backend is "localhost", you must have built a backend and start it.

If you do not specify the address to be "localhost" for the backend, you must specify a valid URL to a hosted backend.

Configuring OIDC

By default the tests will retrieve valid OIDC tokens on behalf of each user specified in environment in order to make API calls. However, if you wish to use JWTs instead, you may set the oidc_client_id environment variable which will use OIDC authentication instead of SAML.

In order to run the integration tests they need to have a valid OIDC client id which can be obtains by performing the following steps:

  1. Go to the "Register your application" page and sign in
  2. Click 'New App'
  3. Select "SPA" application
  4. Specify a client name (can be anything you want)
  5. Add http://localhost:5000 as a redirect url
  6. Hit 'Next' to finish

Actually running the tests

Once all the required environment variables are setup, to run the integration tests:

  1. Install dependencies: npm install
  2. Clean output: npm run clean
  3. Build source: npm run build
  4. Run tests: npm test:integration

Development instructions

The base 'after all' and 'before all' hooks are implemented in TestSetup.test.ts. Any cleanup and setup steps should be added here.

The TestContext class follows the singleton pattern and will automatically be setup when its static instance is invoked via its TestContext.instance(). The setup uses a .env file and process.env to populate the TestContext.