diff --git a/types/har-format/har-format-tests.ts b/types/har-format/har-format-tests.ts index 9a226d150c..00ce0b1e47 100644 --- a/types/har-format/har-format-tests.ts +++ b/types/har-format/har-format-tests.ts @@ -89,6 +89,19 @@ const testEntry: harFormat.Entry = { pageref: "page_1" }; +// Examples from http://www.softwareishard.com/blog/har-12-spec/#cache +const testCacheNoInformation: harFormat.Cache = { +}; + +const testNoCacheAfter: harFormat.Cache = { + afterRequest: null +}; + +const testCacheNotCached: harFormat.Cache = { + beforeRequest: null, + afterRequest: null +}; + const testLog: harFormat.Log = { version: "1.2", creator: testCreator, diff --git a/types/har-format/index.d.ts b/types/har-format/index.d.ts index 3ab7fd773e..31421be8b4 100644 --- a/types/har-format/index.d.ts +++ b/types/har-format/index.d.ts @@ -728,13 +728,13 @@ export interface Cache { * * Leave out this field if the information is not available. */ - beforeRequest?: CacheDetails; + beforeRequest?: CacheDetails | null; /** * State of a cache entry after the request. * * Leave out this field if the information is not available. */ - afterRequest?: CacheDetails; + afterRequest?: CacheDetails | null; /** A comment provided by the user or the application */ comment?: string; }