kopia lustrzana https://gitlab.com/rysiekpl/libresilient
minor fixes (ref. #15)
rodzic
d02cbb7a9d
commit
05e7997e89
|
@ -51,7 +51,7 @@ describe("plugin: alt-fetch", () => {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
test("it should register in LibResilientPlugins", () => {
|
test("it should register in LibResilientPluginConstructors", () => {
|
||||||
require("../../plugins/alt-fetch.js");
|
require("../../plugins/alt-fetch.js");
|
||||||
expect(LibResilientPluginConstructors.get('alt-fetch')().name).toEqual('alt-fetch');
|
expect(LibResilientPluginConstructors.get('alt-fetch')().name).toEqual('alt-fetch');
|
||||||
});
|
});
|
||||||
|
|
|
@ -31,7 +31,7 @@ describe("plugin: fetch", () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
test("it should register in LibResilientPlugins", () => {
|
test("it should register in LibResilientPluginConstructors", () => {
|
||||||
require("../../plugins/fetch.js");
|
require("../../plugins/fetch.js");
|
||||||
expect(LibResilientPluginConstructors.get('fetch')().name).toEqual('fetch');
|
expect(LibResilientPluginConstructors.get('fetch')().name).toEqual('fetch');
|
||||||
});
|
});
|
||||||
|
|
|
@ -17,8 +17,8 @@
|
||||||
LRPC.set(pluginName, (LR, init={})=>{
|
LRPC.set(pluginName, (LR, init={})=>{
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* plugin config settings
|
* plugin config settings
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// sane defaults
|
// sane defaults
|
||||||
let defaultConfig = {
|
let defaultConfig = {
|
||||||
|
@ -60,8 +60,8 @@
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getting content using regular HTTP(S) fetch()
|
* getting content using regular HTTP(S) fetch()
|
||||||
*/
|
*/
|
||||||
let fetchContentFromAlternativeEndpoints = (url) => {
|
let fetchContentFromAlternativeEndpoints = (url) => {
|
||||||
|
|
||||||
// we're going to try a random endpoint and building an URL of the form:
|
// we're going to try a random endpoint and building an URL of the form:
|
||||||
|
|
|
@ -6,18 +6,15 @@
|
||||||
* this plugin does not implement any push method
|
* this plugin does not implement any push method
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
// no polluting of the global namespace please
|
||||||
* no polluting of the global namespace please
|
|
||||||
*/
|
|
||||||
|
|
||||||
(function(LRPC){
|
(function(LRPC){
|
||||||
// this never changes
|
// this never changes
|
||||||
const pluginName = "fetch"
|
const pluginName = "fetch"
|
||||||
LRPC.set(pluginName, (LR, init={})=>{
|
LRPC.set(pluginName, (LR, init={})=>{
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* plugin config settings
|
* plugin config settings
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// sane defaults
|
// sane defaults
|
||||||
let defaultConfig = {}
|
let defaultConfig = {}
|
||||||
|
|
Ładowanie…
Reference in New Issue