diff --git a/package.json b/package.json index 6101784..82dc743 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "build": "rm -rf dist && mkdir dist && tsc --declaration --outDir dist --rootDir src", "build:example": "rm -rf dist && mkdir dist && tsc --declaration --outDir dist --project example.tsconfig.json", "start": "npm run build:example && node dist/example/index.js", - "prepublish": "npm run build" + "test": "tsc --noEmit --strictNullChecks test/index.ts --moduleResolution node", + "prepublish": "npm run build && npm test" }, "repository": { "type": "git", diff --git a/src/Responses.ts b/src/Responses.ts index 63e020b..e27580c 100644 --- a/src/Responses.ts +++ b/src/Responses.ts @@ -3,5 +3,5 @@ import { Reference } from './Reference'; export interface Responses { default?: Response | Reference; - [httpStatusCode: string]: Response | Reference; + [httpStatusCode: string]: Response | Reference | undefined; } diff --git a/test/index.ts b/test/index.ts new file mode 100644 index 0000000..88743d2 --- /dev/null +++ b/test/index.ts @@ -0,0 +1 @@ +import {odata2openapi} from '../dist' diff --git a/tsconfig.json b/tsconfig.json index 9ebef56..a302081 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,6 +12,7 @@ }, "exclude": [ "dist", + "test", "node_modules", "example" ]