Quip Live Apps Test Utilities

raw JSON →
0.1.3 verified Sat Apr 25 auth: no javascript

Testing utilities for Quip Live Apps development. Version 0.1.3 is the initial release with basic testing helpers. This package provides utilities to mock Quip Live Apps environment and write unit tests for Quip Live Apps. It includes helpers for creating test records, simulating user actions, and validating Quip-specific behaviors. Key differentiators include tight integration with Quip Live Apps API and simplified test setup. Currently in early development with likely breaking changes.

error TypeError: mockQuipApp is not a function
cause Incorrect import: using default import instead of named.
fix
Use import { mockQuipApp } from 'quip-test-utils'.
error Module not found: Can't resolve 'quip-test-utils' in ...
cause Package not installed or not in node_modules.
fix
Run npm install quip-test-utils --save-dev or equivalent.
error SyntaxError: Cannot use import statement outside a module
cause Using ESM import in a CommonJS context without type: module.
fix
Add 'type': 'module' to package.json or use .mjs extension.
breaking Version 0.x is unstable; APIs may change without notice.
fix Lock to exact version and monitor changelog for breaking changes.
deprecated Deprecation warning in future versions expected as package matures.
fix Stay updated with latest release notes.
gotcha createQuipTestRecord does not persist records; they are in-memory only.
fix Use with test runner that provides isolation between tests.
gotcha simulateUserAction does not trigger real HTTP requests; only local event simulation.
fix Do not rely on this for network behavior testing.
npm install quip-test-utils
yarn add quip-test-utils
pnpm add quip-test-utils

This shows basic setup: mock app environment, create test record, simulate user interaction, and cleanup.

import { createQuipTestRecord, mockQuipApp, simulateUserAction, cleanupTestRecords } from 'quip-test-utils';

// Mock Quip App environment
mockQuipApp(process.env.QUIP_APP_ID ?? 'test-app-id');

// Create a test record
const record = createQuipTestRecord('task', { title: 'Test task', status: 'open' });

// Simulate user action
simulateUserAction({ type: 'click', element: record.get('title') });

console.log('Record created:', record.getData());

// Clean up after test
cleanupTestRecords();