WeTransfer / Mocker

Mock Alamofire and URLSession requests without touching your code implementation
MIT License
1.12k stars 96 forks source link

Add cacheStoragePolicy option #73

Closed krzyzanowskim closed 3 years ago

krzyzanowskim commented 4 years ago

This PR adds optional cacheStoragePolicy. Defaults to .notAllowed for backward compatibility.

Mock(url: originalURL, cacheStoragePolicy: .allowed,
     dataType: .json, statusCode: 200,
     data: [.get: MockedData.exampleJSON.data],
     additionalHeaders: ["Cache-Control": "public, max-age=31557600, immutable"]
).register()

Resolves https://github.com/WeTransfer/Mocker/issues/72

wetransferplatform commented 4 years ago
Warnings
:warning: Consider to place some `MARK:` lines for Sources/Mock.swift, which is over 200 lines big.
Messages
:book: View more details on Bitrise
:book: Mocker: Executed 22 tests, with 0 failures (0 unexpected) in 1.789 (1.805) seconds

Mocker.framework: Coverage: 88.65

File Coverage
Mock.swift 84.78%
MockingURLProtocol.swift 86.54%

Generated by :no_entry_sign: Danger Swift against 3d297a4dbd1bd055a2934ed2b0e24856d46063d1

krzyzanowskim commented 3 years ago

will it happen?

AvdLee commented 3 years ago

will it happen?

It's unbelievable. Today I woke up and thought: Let's merge everything! It's a feeling hard to describe but best understandable after pressing the green merge button.

Amen 🙏