Hps Testing Plugin for Vendure | Hyperse Hub
hps-testing is a Hps Testing plugin in the Hub Base group.hps-testing provides Hps Testing plugin capabilities for Hub Base. Shared open libraries, utilities, and testing foundations.
Core Vendure Plugins
Specifications Technical details and package information for this product.
Package
@hyperse-hub/hps-testing
Support languages
TypeScript, JavaScript, Prolog, Shell
Last published
July 02, 2026
@hyperse-hub/hps-testing
Testing utilities for Hub Base plugin development and integration tests.
Install
yarn add -D @hyperse-hub/hps-testing
What is included
Vendure test server bootstrap helpers (createTestServer, resolveTestServerPort)
Nest test module helper (createTestModule)
GraphQL helpers (SimpleGraphQLClient, gql.tada re-exports)
Initial data and fixture helpers (initialData, getInitialData, getProductsCsvPath)
User/context utilities (getAdminCtx, loginAsShopUser)
Async testing helpers (awaitRunningJobs, sleep)
Playwright GraphQL tooling (PlaywrightGraphqlClient, createUploadPostData)
Exported API (overview)
createTestServer(options): create and configure a Vendure test server environment.
createTestModule(options): create a lightweight Nest/Vendure testing module.
awaitRunningJobs(adminClient, timeout?, delay?): wait for background jobs to settle.
getAdminCtx(app): build an admin RequestContext from a running test app.
loginAsShopUser({ app, shopClient, useNewUser? }): login helper for shop-side tests.
initialData, initialDataWithAsset, getInitialData(): reusable Vendure seed data.
getProductsCsvPath(type?): resolve bundled CSV fixture path (normal/full).
Quick usage
Playwright upload example
Initial data example
Local development
yarn lint
yarn test-unit
yarn typecheck
Notes
awaitRunningJobs() throws when timeout is reached (default 5000ms).
createTestServer() supports deterministic dev ports (devPort) and dynamic e2e ports.
createUploadPostData() expects Upload placeholders to be null in mapped variables.
sleep(ms?): simple async delay utility.
createUploadPostData(mutation, filePaths, mapVariables): build multipart upload request payload.
PlaywrightGraphqlClient: typed request client for GraphQL calls in Playwright tests.
testSuccessfulPaymentMethod: ready-to-use payment handler for test flows.
Re-exported from gql.tada: initGraphQLTada, readFragment, FragmentOf, ResultOf, VariablesOf. import { createTestServer, awaitRunningJobs } from '@hyperse-hub/hps-testing' ;
const { server, adminClient } = await createTestServer ( {
type: 'e2e' ,
} ) ;
await server. init ( {
initialData: { } ,
} ) ;
await awaitRunningJobs ( adminClient) ;
import { gql } from 'graphql-tag' ;
import { createUploadPostData } from '@hyperse-hub/hps-testing' ;
const postData = createUploadPostData (
gql`
mutation CreateAssets($input: [CreateAssetInput!]!) {
createAssets(input: $input) {
id
}
}
` ,
[ 'a.jpg' , 'b.jpg' ] ,
( filePaths) => ( {
input: filePaths. map ( ( ) => ( { file: null } ) ) ,
} )
) ;
import { getInitialData, getProductsCsvPath } from '@hyperse-hub/hps-testing' ;
const initialData = getInitialData ( { withAsset: true } ) ;
const csvPath = getProductsCsvPath ( 'full' ) ;