Skip to content

Commit

Permalink
Relax send() method typing (#63)
Browse files Browse the repository at this point in the history
* refacto: relaxes send method typing. Closes #62

* chore: updates contributors and bumps version
  • Loading branch information
tairosonloa authored Nov 11, 2021
1 parent 602b270 commit 6ca88b6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
{
"name": "tepper",
"version": "0.3.3",
"version": "0.3.4",
"description": "Modern library for testing HTTP servers",
"main": "dist/tepper.js",
"engines": {
"node": ">= 12.13.0"
},
"homepage": "https://github.com/DanielRamosAcosta/tepper",
"repository": "https://github.com/DanielRamosAcosta/tepper",
"author": "Daniel Ramos <[email protected]>",
"contributors": [
"Daniel Ramos <[email protected]>"
"Daniel Ramos <[email protected]>",
"Aitor Alonso <[email protected]>"
],
"license": "MIT",
"scripts": {
Expand Down
8 changes: 4 additions & 4 deletions src/TepperBuilder.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { ParsedUrlQueryInput } from "querystring"
import { BaseUrlServerOrExpress } from "./BaseUrlServerOrExpress"
import { DebugOptions } from "./DebugOptions"
import { TepperConfig } from "./TepperConfig"
import { TepperResult } from "./TepperResult"
import { TepperRunner } from "./TepperRunner"
import { BaseUrlServerOrExpress } from "./BaseUrlServerOrExpress"
import { ParsedUrlQueryInput } from "querystring"
import { DebugOptions } from "./DebugOptions"
export class TepperBuilder {
public constructor(
private readonly baseUrlServerOrExpress: BaseUrlServerOrExpress,
Expand Down Expand Up @@ -50,7 +50,7 @@ export class TepperBuilder {
})
}

public send(body: Record<string, unknown> | Array<unknown>) {
public send(body: string | object) {
return new TepperBuilder(this.baseUrlServerOrExpress, {
...this.config,
body,
Expand Down
2 changes: 1 addition & 1 deletion src/TepperConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { DebugOptions } from "./DebugOptions"
export type TepperConfig = {
readonly method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE"
readonly path: string
readonly body: Record<string, unknown> | Array<unknown> | null
readonly body: string | object | null
readonly query: ParsedUrlQueryInput | null
readonly redirects: number
readonly expectedStatus: number | null
Expand Down

0 comments on commit 6ca88b6

Please sign in to comment.