A collection of JavaScript reporter classes for the Jasmine BDD testing framework that output test results in various formats including JUnit XML, NUnit XML, TAP, TeamCity, AppVeyor, and Terminal
—
Pending
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Pending
The risk profile of this skill
Cloud-based CI system integration that posts test results to external APIs during test execution. Provides real-time test result reporting to CI platforms for immediate feedback and build status updates.
Posts test results to AppVeyor build system via HTTP API with configurable batching and output formatting. Requires AppVeyor environment to be properly configured with API endpoint information.
/**
* Creates an AppVeyor reporter instance that posts results to AppVeyor API
* @param options - Configuration options for AppVeyor integration
* @returns Reporter instance implementing Jasmine reporter interface
*/
function AppVeyorReporter(options?: AppVeyorOptions): Reporter;
interface AppVeyorOptions {
/** Spec batch size to report to AppVeyor, higher values reduce API calls (default: 50) */
batchSize?: number;
/** Verbosity level 0-2+, controls logging output (default: 0) */
verbosity?: number;
/** Enable colored console output for logging (default: true) */
color?: boolean;
}Environment Requirements:
The AppVeyor reporter requires the APPVEYOR_API_URL environment variable to be set by the AppVeyor build environment. This is automatically provided when running in AppVeyor CI.
Usage Examples:
// Basic AppVeyor integration with default settings
const appveyorReporter = new jasmineReporters.AppVeyorReporter();
jasmine.getEnv().addReporter(appveyorReporter);
// Custom batch size and verbose logging
const appveyorReporter = new jasmineReporters.AppVeyorReporter({
batchSize: 25,
verbosity: 2,
color: true
});
// High-throughput configuration for large test suites
const appveyorReporter = new jasmineReporters.AppVeyorReporter({
batchSize: 100,
verbosity: 0,
color: false
});The AppVeyor reporter communicates with the AppVeyor Test API to report test results in real-time.
/**
* Internal API configuration derived from environment variables
*/
interface AppVeyorApi {
/** API host extracted from APPVEYOR_API_URL */
host: string;
/** API port extracted from APPVEYOR_API_URL */
port: string;
/** API endpoint path for batch test reporting */
endpoint: string; // "/api/tests/batch"
}
/**
* Test result format sent to AppVeyor API
*/
interface AppVeyorTestResult {
/** Full qualified test name including suite and spec names */
testName: string;
/** Testing framework identifier */
testFramework: "jasmine2";
/** Test execution duration in milliseconds */
durationMilliseconds: number;
/** Test outcome using AppVeyor terminology */
outcome: "Passed" | "Failed" | "Skipped" | "Ignored" | "None";
/** Error message from first failed expectation (if any) */
ErrorMessage?: string;
/** Stack trace from first failed expectation (if any) */
ErrorStackTrace?: string;
}The reporter uses Node.js http module to send POST requests to the AppVeyor API.
Request Configuration:
/api/tests/batchError Handling:
Tests are batched to optimize API performance and reduce network overhead.
Batching Behavior:
jasmineDone)Batch Size Considerations:
Configurable logging provides insight into reporter operation and API communication.
Verbosity Levels:
Color Support:
Jasmine test states are mapped to AppVeyor outcome terminology:
| Jasmine Status | AppVeyor Outcome | Description |
|---|---|---|
| "passed" | "Passed" | Test executed successfully |
| "failed" | "Failed" | Test failed with assertion errors |
| "pending" | "Skipped" | Test skipped with xit() or pending() |
| "disabled" | "Ignored" | Test disabled with xdescribe() or filtered |
/** Called when a test spec starts - records start time */
specStarted(spec: Spec): void;
/** Called when a test spec completes - processes result and adds to batch */
specDone(spec: Spec): void;
/** Called when all tests complete - sends remaining batch results */
jasmineDone(): void;State Management:
AppVeyor Configuration (appveyor.yml):
test_script:
- npm test
environment:
# APPVEYOR_API_URL is automatically set by AppVeyorTest Runner Integration:
// spec/support/jasmine.json or similar
const reporters = require('jasmine-reporters');
if (process.env.APPVEYOR) {
const appveyorReporter = new reporters.AppVeyorReporter({
batchSize: 50,
verbosity: 1
});
jasmine.getEnv().addReporter(appveyorReporter);
}Combined with Other Reporters:
// Use AppVeyor reporter alongside terminal output
const reporters = require('jasmine-reporters');
jasmine.getEnv().addReporter(new reporters.TerminalReporter({
verbosity: 2,
color: true
}));
if (process.env.APPVEYOR) {
jasmine.getEnv().addReporter(new reporters.AppVeyorReporter({
batchSize: 75,
verbosity: 0 // Silent to avoid duplicate output
}));
}