mirror of
https://github.com/silkimen/cordova-plugin-advanced-http.git
synced 2026-01-31 00:00:03 +08:00
28 lines
1.3 KiB
JavaScript
28 lines
1.3 KiB
JavaScript
const tests = [
|
|
{
|
|
description: 'should reject self signed cert (GET)',
|
|
expected: 'rejected: {"status":-1,"error":"cancelled"}',
|
|
func: function() { cordova.plugin.http.get('https://self-signed.badssl.com/', {}, {}, app.resolve, app.reject); }
|
|
},{
|
|
description: 'should reject self signed cert (PUT)',
|
|
expected: 'rejected: {"status":-1,"error":"cancelled"}',
|
|
func: function() { cordova.plugin.http.put('https://self-signed.badssl.com/', { test: 'testString' }, {}, app.resolve, app.reject); }
|
|
},{
|
|
description: 'should reject self signed cert (POST)',
|
|
expected: 'rejected: {"status":-1,"error":"cancelled"}',
|
|
func: function() { cordova.plugin.http.post('https://self-signed.badssl.com/', { test: 'testString' }, {}, app.resolve, app.reject); }
|
|
},{
|
|
description: 'should reject self signed cert (PATCH)',
|
|
expected: 'rejected: {"status":-1,"error":"cancelled"}',
|
|
func: function() { cordova.plugin.http.patch('https://self-signed.badssl.com/', { test: 'testString' }, {}, app.resolve, app.reject); }
|
|
},{
|
|
description: 'should reject self signed cert (DELETE)',
|
|
expected: 'rejected: {"status":-1,"error":"cancelled"}',
|
|
func: function() { cordova.plugin.http.delete('https://self-signed.badssl.com/', {}, {}, app.resolve, app.reject); }
|
|
}
|
|
];
|
|
|
|
if (module && module.exports) {
|
|
module.exports = tests;
|
|
}
|