db-client.test.js — astro Source File
Architecture documentation for db-client.test.js, a javascript file in the astro codebase. 3 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR a6782891_dcec_f780_2784_eb44aae893fa["db-client.test.js"] 8006363a_659e_fff7_b2b0_bf56d7a9d676["../../dist/core/db-client/utils.js"] a6782891_dcec_f780_2784_eb44aae893fa --> 8006363a_659e_fff7_b2b0_bf56d7a9d676 db323e8c_04ef_9777_0487_224de5819a30["node:assert"] a6782891_dcec_f780_2784_eb44aae893fa --> db323e8c_04ef_9777_0487_224de5819a30 6b0635f9_51ea_77aa_767b_7857878e98a6["node:test"] a6782891_dcec_f780_2784_eb44aae893fa --> 6b0635f9_51ea_77aa_767b_7857878e98a6 style a6782891_dcec_f780_2784_eb44aae893fa fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import assert from 'node:assert';
import test, { describe } from 'node:test';
import { parseLibSQLConfig } from '../../dist/core/db-client/utils.js';
describe('db client config', () => {
test('parse config options from URL (docs example url)', () => {
const remoteURLToParse = new URL(
'file://local-copy.db?encryptionKey=your-encryption-key&syncInterval=60&syncUrl=libsql%3A%2F%2Fyour.server.io',
);
const options = Object.fromEntries(remoteURLToParse.searchParams.entries());
const config = parseLibSQLConfig(options);
assert.deepEqual(config, {
encryptionKey: 'your-encryption-key',
syncInterval: 60,
syncUrl: 'libsql://your.server.io',
});
});
test('parse config options from URL (test booleans without value)', () => {
const remoteURLToParse = new URL('file://local-copy.db?readYourWrites&offline&tls');
const options = Object.fromEntries(remoteURLToParse.searchParams.entries());
const config = parseLibSQLConfig(options);
assert.deepEqual(config, {
readYourWrites: true,
offline: true,
tls: true,
});
});
test('parse config options from URL (test booleans with value)', () => {
const remoteURLToParse = new URL(
'file://local-copy.db?readYourWrites=true&offline=true&tls=true',
);
const options = Object.fromEntries(remoteURLToParse.searchParams.entries());
const config = parseLibSQLConfig(options);
assert.deepEqual(config, {
readYourWrites: true,
offline: true,
tls: true,
});
});
test('parse config options from URL (test numbers)', () => {
const remoteURLToParse = new URL('file://local-copy.db?syncInterval=60&concurrency=2');
const options = Object.fromEntries(remoteURLToParse.searchParams.entries());
const config = parseLibSQLConfig(options);
assert.deepEqual(config, {
syncInterval: 60,
concurrency: 2,
});
});
});
Domain
Dependencies
- ../../dist/core/db-client/utils.js
- node:assert
- node:test
Source
Frequently Asked Questions
What does db-client.test.js do?
db-client.test.js is a source file in the astro codebase, written in javascript. It belongs to the CoreAstro domain.
What does db-client.test.js depend on?
db-client.test.js imports 3 module(s): ../../dist/core/db-client/utils.js, node:assert, node:test.
Where is db-client.test.js in the architecture?
db-client.test.js is located at packages/db/test/unit/db-client.test.js (domain: CoreAstro, directory: packages/db/test/unit).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free