REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 1.62 KB
Close
/proc/thread-self/root/home/byroehnu/.trash/node_modules11/adminjs/lib/backend/bundler/generate-user-component-entry.spec.js
Text
Base64
import path from 'path'; import * as url from 'url'; import AdminJS from '../../adminjs.js'; import { ComponentLoader } from '../utils/index.js'; import generateUserComponentEntry from './generate-user-component-entry.js'; const __dirname = url.fileURLToPath(new URL('.', import.meta.url)); const exampleComponent = '../../../spec/fixtures/example-component.js'; const entryPath = './'; describe('generateUserComponentEntry', function () { it('defines AdminJS.UserComponents', function () { const adminJs = new AdminJS(); const entryFile = generateUserComponentEntry(adminJs, entryPath); expect(entryFile).to.have.string('AdminJS.UserComponents = {}\n'); }); it('adds env variables to the entry file', function () { const adminJs = new AdminJS({ env: { ENV_NAME: 'value' } }); const entryFile = generateUserComponentEntry(adminJs, entryPath); expect(entryFile).to.have.string('AdminJS.env.ENV_NAME = "value"\n'); }); it('adds components to the entry file', function () { const loader = new ComponentLoader(); const componentId = loader.add('ExampleComponent', exampleComponent); const adminJs = new AdminJS({ componentLoader: loader }); const rootEntryPath = path.resolve(entryPath); const filePath = path.relative(rootEntryPath, path.normalize(path.join(__dirname, exampleComponent))); const entryFile = generateUserComponentEntry(adminJs, entryPath); expect(entryFile).to.have.string([`import ${componentId} from '${filePath.replace('.js', '')}'`, `AdminJS.UserComponents.${componentId} = ${componentId}`].join('\n')); AdminJS.UserComponents = {}; }); });
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 6
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
utils
DIR
-
drwxr-xr-x
2026-02-28 00:31:26
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
app.bundler.js
1.36 KB
lrw-r--r--
2026-02-28 00:31:14
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
components.bundler.js
1.72 KB
lrw-r--r--
2026-02-28 00:31:26
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
generate-user-component-entry.js
1.39 KB
lrw-r--r--
2026-02-28 00:31:34
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
generate-user-component-entry.spec.js
1.62 KB
lrw-r--r--
2026-02-28 00:31:34
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
globals.bundler.js
1.65 KB
lrw-r--r--
2026-02-28 00:31:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.js
382 B
lrw-r--r--
2026-02-28 00:31:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).