@fluwa-tool/sdk 1.0.35 → 1.0.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -97,9 +97,6 @@ class XMLHttpRequestInterceptor {
|
|
|
97
97
|
// Simular a resposta mockada assincronamente
|
|
98
98
|
setTimeout(() => {
|
|
99
99
|
try {
|
|
100
|
-
// Simular readyState = 4 (completo)
|
|
101
|
-
// Criar um evento fake que faz parecer que a resposta chegou
|
|
102
|
-
const mockEvent = new Event('readystatechange');
|
|
103
100
|
// Injetar dados fake no xhr para simular resposta
|
|
104
101
|
Object.defineProperty(xhr, 'readyState', {
|
|
105
102
|
value: 4,
|
|
@@ -126,8 +123,9 @@ class XMLHttpRequestInterceptor {
|
|
|
126
123
|
// Registrar completamento do mock
|
|
127
124
|
self.requestLogger.logComplete(requestMetadata).catch(() => { });
|
|
128
125
|
// Chamar handler original para processar a "resposta"
|
|
126
|
+
// Sem Event object (React Native não suporta)
|
|
129
127
|
if (originalOnReadyStateChange) {
|
|
130
|
-
originalOnReadyStateChange.call(xhr
|
|
128
|
+
originalOnReadyStateChange.call(xhr);
|
|
131
129
|
}
|
|
132
130
|
}
|
|
133
131
|
catch (error) {
|