Release room-scoped Matrix bot plugins and room configuration
This commit is contained in:
commit
86c7e4359c
76 files changed
+13539
No files matched your search
@@ -0,0 +1,18 @@
|
||||
const blocked = () => { throw new Error('Network access is disabled in test subprocesses'); };
|
||||
require('node:http').request = blocked;
|
||||
require('node:http').get = blocked;
|
||||
require('node:https').request = blocked;
|
||||
require('node:https').get = blocked;
|
||||
require('node:net').Socket.prototype.connect = blocked;
|
||||
require('node:tls').connect = blocked;
|
||||
global.fetch = blocked;
|
||||
const fs = require('node:fs');
|
||||
const exists = fs.existsSync.bind(fs);
|
||||
const read = fs.readFileSync.bind(fs);
|
||||
const privateConfiguration = path => typeof path === 'string' &&
|
||||
(/(^|\/)\.env(?:\..*)?$/.test(path) || /(^|\/)config\/bots\.yaml$/.test(path));
|
||||
fs.existsSync = path => privateConfiguration(path) ? false : exists(path);
|
||||
fs.readFileSync = (path, ...args) => {
|
||||
if (privateConfiguration(path)) throw new Error('Runtime configuration is unavailable in tests');
|
||||
return read(path, ...args);
|
||||
};
|
||||
Reference in new issue
Block a user