WeTransfer / Mocker

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

Add extra capabilities for on request handling #139

Closed AvdLee closed 2 years ago

AvdLee commented 2 years ago

During updating our internal projects to the latest major release of Mocker it turned out that the on-request handler could be improved with a few common scenarios. We now offer callbacks for:

I'm convinced this will level up the possibilities our framework offers to all our users. Secondly, we didn't test all scenarios, so I added a few more to increase coverage.

wetransferplatform commented 2 years ago
Warnings
:warning: 'onRequest' is deprecated: Use `onRequestHandler` instead.
:warning: 'onRequest' is deprecated: Use `onRequestHandler` instead.
Messages
:book: View more details on Bitrise
:book: MockerTests: Executed 30 tests (0 failed, 0 retried, 0 skipped) in 1.778 seconds

SwiftLint found issues

Severity File Reason
Warning OnRequestHandler.swift:47 Line should be 140 characters or less: currently 149 characters (line_length)
Error OnRequestHandler.swift:57 Line should be 160 characters or less: currently 168 characters (line_length)
Error OnRequestHandler.swift:73 Line should be 160 characters or less: currently 163 characters (line_length)
Warning Mock.swift:87 Computed properties should declare first the getter and then the setter. (computed_accessors_order)
Error Mock.swift:8 Line should be 160 characters or less: currently 177 characters (line_length)
Warning Mock.swift:49 Line should be 140 characters or less: currently 155 characters (line_length)
Error Mock.swift:81 Line should be 160 characters or less: currently 211 characters (line_length)
Error Mock.swift:84 Line should be 160 characters or less: currently 208 characters (line_length)
Error Mock.swift:95 Line should be 160 characters or less: currently 217 characters (line_length)
Error Mock.swift:104 Line should be 160 characters or less: currently 287 characters (line_length)
Warning Mock.swift:133 Line should be 140 characters or less: currently 142 characters (line_length)
Warning Mock.swift:140 Line should be 140 characters or less: currently 141 characters (line_length)
Error Mock.swift:147 Line should be 160 characters or less: currently 246 characters (line_length)
Error Mock.swift:148 Line should be 160 characters or less: currently 236 characters (line_length)
Warning Mock.swift:159 Line should be 140 characters or less: currently 150 characters (line_length)
Warning Mock.swift:160 Line should be 140 characters or less: currently 153 characters (line_length)
Warning Mock.swift:196 Line should be 140 characters or less: currently 159 characters (line_length)
Error Mock.swift:206 Line should be 160 characters or less: currently 168 characters (line_length)
Warning MockerTests.swift:163 Line should be 140 characters or less: currently 151 characters (line_length)
Warning MockerTests.swift:181 Line should be 140 characters or less: currently 149 characters (line_length)
Warning MockerTests.swift:239 Line should be 140 characters or less: currently 154 characters (line_length)
Warning MockerTests.swift:52 Chained function calls should be either on the same line, or one per line. (multiline_function_chains)
Warning MockerTests.swift:71 Chained function calls should be either on the same line, or one per line. (multiline_function_chains)
Warning MockerTests.swift:94 Chained function calls should be either on the same line, or one per line. (multiline_function_chains)
Warning MockerTests.swift:116 Chained function calls should be either on the same line, or one per line. (multiline_function_chains)
Warning MockerTests.swift:149 Chained function calls should be either on the same line, or one per line. (multiline_function_chains)
Warning MockerTests.swift:165 Chained function calls should be either on the same line, or one per line. (multiline_function_chains)
Warning MockerTests.swift:183 Chained function calls should be either on the same line, or one per line. (multiline_function_chains)
Warning MockerTests.swift:206 Chained function calls should be either on the same line, or one per line. (multiline_function_chains)
Warning MockerTests.swift:259 Chained function calls should be either on the same line, or one per line. (multiline_function_chains)
Warning MockerTests.swift:520 Chained function calls should be either on the same line, or one per line. (multiline_function_chains)
Warning MockerTests.swift:554 Chained function calls should be either on the same line, or one per line. (multiline_function_chains)

Code Coverage Report

Name Coverage
Mocker 88.59%

Generated by :no_entry_sign: Danger Swift against b0d713ea555818f883cc6e548a94cbdc31dfb954

wetransferplatform commented 2 years ago

Congratulations! :tada: This was released as part of Release 3.0.1 :rocket:

Generated by GitBuddy