Linux v69820.1blu.de 4.15.0 #1 SMP Mon Sep 30 15:36:27 MSK 2024 x86_64
Apache/2.4.58
Server IP : 195.90.215.149 & Your IP : 216.73.216.250
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
share /
nodejs /
libtap /
lib /
Delete
Unzip
Name
Size
Permission
Date
Action
base.js
8.66
KB
-rw-r--r--
2023-12-12 09:48
clean-yaml-object.js
4.04
KB
-rw-r--r--
2023-12-12 09:48
diags.js
130
B
-rw-r--r--
2023-12-12 09:48
esc.js
134
B
-rw-r--r--
2023-12-12 09:48
extra-from-error.js
1.93
KB
-rw-r--r--
2023-12-12 09:48
fake-process.js
162
B
-rw-r--r--
2023-12-12 09:48
find-main-script.js
292
B
-rw-r--r--
2023-12-12 09:48
fixture.js
2.28
KB
-rw-r--r--
2023-12-12 09:48
mock.js
2.82
KB
-rw-r--r--
2023-12-12 09:48
obj-to-yaml.js
371
B
-rw-r--r--
2023-12-12 09:48
parse-test-args.js
1.42
KB
-rw-r--r--
2023-12-12 09:48
point.js
1.12
KB
-rw-r--r--
2023-12-12 09:48
process.js
99
B
-rw-r--r--
2023-12-12 09:48
snapshot.js
3.01
KB
-rw-r--r--
2023-12-12 09:48
spawn.js
4.38
KB
-rw-r--r--
2023-12-12 09:48
stack.js
117
B
-rw-r--r--
2023-12-12 09:48
stdin.js
875
B
-rw-r--r--
2023-12-12 09:48
tap.js
6.06
KB
-rw-r--r--
2023-12-12 09:48
tap.mjs
623
B
-rw-r--r--
2023-12-12 09:48
test.js
50.31
KB
-rw-r--r--
2023-12-12 09:48
waiter.js
1.13
KB
-rw-r--r--
2023-12-12 09:48
Save
Rename
const Module = require('module') const { isAbsolute } = require('path') const process = require('./process.js') const isPlainObject = obj => obj && typeof obj === 'object' && (Object.getPrototypeOf(obj) === null || Object.getPrototypeOf(obj) === Object.prototype) class Mock { constructor(parentFilename, filename, mocks = {}) { this.filename = filename this.mocks = new Map() if (!parentFilename || typeof parentFilename !== 'string') { throw new TypeError('A parentFilename is required to resolve Mocks paths') } if (!filename || typeof filename !== 'string') { throw new TypeError('t.mock() first argument should be a string') } if (!isPlainObject(mocks)) { throw new TypeError( 'mocks should be a a key/value object in which keys ' + `are the same used in ${filename} require calls` ) } const self = this const callerTestRef = Module._cache[parentFilename] const filePath = Module._resolveFilename(filename, callerTestRef) // populate mocks Map from resolved filenames for (const key of Object.keys(mocks)) { const mockFilePath = Module._resolveFilename(key, callerTestRef) this.mocks.set(mockFilePath, mocks[key]) } // keep a cache system for non-mocked files const seen = new Map() class MockedModule extends Module { require (id) { const requiredFilePath = Module._resolveFilename(id, this) // if it's a mocked file, just serve that instead if (self.mocks.has(requiredFilePath)) return self.mocks.get(requiredFilePath) // builtin, not-mocked modules need to be loaded via regular require fn const isWindows = process.platform === 'win32' /* istanbul ignore next - platform dependent code path */ const isRelative = id.startsWith('./') || id.startsWith('../') || ((isWindows && id.startsWith('.\\')) || id.startsWith('..\\')) if (!isRelative && !isAbsolute(id)) return super.require(id) // if non-mocked file that we've seen, return that instead // this enable cicle-required deps to work if (seen.has(requiredFilePath)) return seen.get(requiredFilePath).exports // load any not-mocked module via our MockedModule class // also sets them in our t.mock realm cache to avoid cycles const unmockedModule = new MockedModule(requiredFilePath, this) seen.set(requiredFilePath, unmockedModule) unmockedModule.load(requiredFilePath) return unmockedModule.exports } } this.module = new MockedModule(filePath, callerTestRef) this.module.load(filePath) } static get(parentFilename, filename, mocks) { const mock = new Mock(parentFilename, filename, mocks) return mock.module.exports } } module.exports = Mock