UNPKG

coveralls-api

Version:
68 lines (67 loc) 2.48 kB
import Coveralls, { Service } from "../"; import { PostJobFromLCOVArgs, SourceFile } from "./from-lcov"; import { GitData } from "./git"; export declare type PostJobResponse = { message: string; url: string; }; /** * A hash representing the coverage data from a single run of a test suite. You must specify either `repo_token` or a service name and job id. */ export declare type PostJobBody = { /** * The secret token for your repository, found at the bottom of your repository’s page on Coveralls. */ repo_token?: string; /** * A timestamp of when the job ran. If a string is provided, must be parsable by Ruby. */ run_at?: string; } & PostJobArgs; export declare type PostJobArgs = { /** * An array of source files, including their coverage data. */ source_files: SourceFile[]; } & BaseJobArgs; export declare type BaseJobArgs = { /** * The CI service or other environment in which the test suite was run. * This can be anything, but certain services have special features (travis-ci, travis-pro, or coveralls-ruby). */ service_name?: string; /** * The build number. Will default to chronological numbering from builds on repo. */ service_number?: string; /** * A unique identifier of the job on the service specified by service_name. */ service_job_id?: string; /** * The associated pull request ID of the build. Used for updating the status and/or commenting. */ service_pull_request?: string; /** * If this is set, the build will not be considered done until a webhook has been sent to https://coveralls.io/webhook?repo_token=… */ parallel?: boolean; /** * If this is set, the job being reported will be named in the view and have it’s own independent status reported to your VCS provider. */ flag_name?: string; /** * A hash of Git data that can be used to display more information to users. */ git?: GitData; /** * The current SHA of the commit being built to override the “git” parameter. */ commit_sha?: string; /** * A timestamp of when the job ran. If a string is provided, must be parsable by Ruby. */ run_at?: Date | string; }; export declare function getJobBody(service: Service, user: string, name: string, args: PostJobArgs | PostJobFromLCOVArgs, coveralls: Coveralls): Promise<PostJobBody>; export { PostJobFromLCOVArgs };