Velocious Full-Stack Framework

1.0.336 · active · verified Wed Apr 22

Velocious is a comprehensive full-stack JavaScript/TypeScript framework providing a concurrent multi-threaded web server, a database framework with MVC concepts, and shared database models for both frontend and backend development. It includes features like database migrations, declarative state machines for models, and Rails-style nested-attribute writes. The current stable version is 1.0.336, suggesting a fairly active development cycle with frequent updates. Key differentiators include its unified model approach across frontend and backend, advanced testing capabilities like parallel test splitting and browser system tests, and integrated tooling for configuration and project initialization. It aims to provide a robust environment for building modern web applications with a focus on developer experience and performance.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates project initialization, basic test structure with tagging, retries, and configuring test behaviors, including event listeners for test retries.

import { configureTests } from 'velocious/build/src/testing/test.js';
import { testEvents } from 'velocious/build/src/testing/test.js';

// Initialize a new Velocious project
// This creates basic project structure and config files.
// npx velocious init

// Example test configuration
export default async function configureTesting() {
  configureTests({ excludeTags: ["mssql"] });
}

// Example of test suite setup with tagging and retries
describe("User Management", {tags: ["api", "db"]}, () => {
  beforeAll(async () => {
    // Setup database or other services before all tests in this suite
    console.log("Setting up user management suite...");
  });

  it("creates a new user successfully", {tags: ["fast", "write"]}, async () => {
    // Simulate user creation logic
    await new Promise(resolve => setTimeout(resolve, 50));
    expect(true).toBe(true);
  });

  it("handles duplicate username registration", {retry: 1}, async () => {
    // Simulate error handling for duplicates
    await new Promise(resolve => setTimeout(resolve, 30));
    expect(false).toBe(false);
  });

  afterAll(async () => {
    // Teardown services after all tests
    console.log("Tearing down user management suite.");
  });
});

// Listen for test retry events
testEvents.on("testRetrying", ({ testDescription, nextAttempt }) => {
  console.log(`Retrying "${testDescription}" (attempt ${nextAttempt})`);
});

testEvents.on("testRetried", ({ testDescription, attemptNumber }) => {
  console.log(`Retry attempt finished for "${testDescription}" (attempt ${attemptNumber})`);
});

// To run these tests: npx velocious test spec/path/to/your-test-spec.js

view raw JSON →