Home / File/ weight.test.js — astro Source File

weight.test.js — astro Source File

Architecture documentation for weight.test.js, a javascript file in the astro codebase. 3 imports, 0 dependents.

Entity Profile

Dependency Diagram

graph LR
  ce6cda72_5485_8388_66f5_6e8de81ba405["weight.test.js"]
  302610c5_2725_9f1a_b450_0bfcfb3b2d40["../dist/index.js"]
  ce6cda72_5485_8388_66f5_6e8de81ba405 --> 302610c5_2725_9f1a_b450_0bfcfb3b2d40
  e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607["strict"]
  ce6cda72_5485_8388_66f5_6e8de81ba405 --> e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607
  6b0635f9_51ea_77aa_767b_7857878e98a6["node:test"]
  ce6cda72_5485_8388_66f5_6e8de81ba405 --> 6b0635f9_51ea_77aa_767b_7857878e98a6
  style ce6cda72_5485_8388_66f5_6e8de81ba405 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import * as assert from 'node:assert/strict';
import { describe, it } from 'node:test';
import { HostRoutes } from '../dist/index.js';

describe('Weight', () => {
	it('Puts higher weighted definitions on top', () => {
		const _redirects = new HostRoutes();
		_redirects.add({
			dynamic: false,
			input: '/a',
			target: '/b',
			weight: 0,
			status: 200,
		});
		_redirects.add({
			dynamic: false,
			input: '/c',
			target: '/d',
			weight: 0,
			status: 200,
		});
		_redirects.add({
			dynamic: false,
			input: '/e',
			target: '/f',
			weight: 1,
			status: 200,
		});
		const firstDefn = _redirects.definitions[0];
		assert.equal(firstDefn.weight, 1);
		assert.equal(firstDefn.input, '/e');
	});
});

Domain

Dependencies

  • ../dist/index.js
  • node:test
  • strict

Frequently Asked Questions

What does weight.test.js do?
weight.test.js is a source file in the astro codebase, written in javascript. It belongs to the CoreAstro domain.
What does weight.test.js depend on?
weight.test.js imports 3 module(s): ../dist/index.js, node:test, strict.
Where is weight.test.js in the architecture?
weight.test.js is located at packages/underscore-redirects/test/weight.test.js (domain: CoreAstro, directory: packages/underscore-redirects/test).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free