parseJS.test.ts — astro Source File
Architecture documentation for parseJS.test.ts, a typescript file in the astro codebase. 4 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 9b159728_ec8f_877b_d482_5f4f245ec741["parseJS.test.ts"] e660f855_08b1_35ca_393f_c779256618fe["../../dist/core/astro2tsx.js"] 9b159728_ec8f_877b_d482_5f4f245ec741 --> e660f855_08b1_35ca_393f_c779256618fe 883dbefe_2d34_de70_5093_4b5bc73d0de4["../../dist/core/parseJS.js"] 9b159728_ec8f_877b_d482_5f4f245ec741 --> 883dbefe_2d34_de70_5093_4b5bc73d0de4 db323e8c_04ef_9777_0487_224de5819a30["node:assert"] 9b159728_ec8f_877b_d482_5f4f245ec741 --> db323e8c_04ef_9777_0487_224de5819a30 6b0635f9_51ea_77aa_767b_7857878e98a6["node:test"] 9b159728_ec8f_877b_d482_5f4f245ec741 --> 6b0635f9_51ea_77aa_767b_7857878e98a6 style 9b159728_ec8f_877b_d482_5f4f245ec741 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import assert from 'node:assert';
import { describe, it } from 'node:test';
import { astro2tsx } from '../../dist/core/astro2tsx.js';
import { extractScriptTags } from '../../dist/core/parseJS.js';
describe('parseJS - Can find all the scripts in an Astro file', () => {
it('Can find all the scripts in an Astro file, including nested tags', () => {
const input = `<script>console.log('hi')</script><div><script>console.log('hi2')</script></div>`;
const { ranges } = astro2tsx(input, 'file.astro');
const scriptTags = extractScriptTags(ranges.scripts);
assert.strictEqual(scriptTags.length, 2);
});
it('Includes JSON scripts', () => {
const input = `<script type="application/json">{foo: "bar"}</script>`;
const { ranges } = astro2tsx(input, 'file.astro');
const scriptTags = extractScriptTags(ranges.scripts);
assert.strictEqual(scriptTags.length, 1);
});
it('returns the proper capabilities for inline script tags', async () => {
const input = `<script is:inline>console.log('hi')</script>`;
const { ranges } = astro2tsx(input, 'file.astro');
const scriptTags = extractScriptTags(ranges.scripts);
scriptTags[0].mappings.forEach((mapping) => {
assert.deepStrictEqual(mapping.data, {
verification: true,
completion: true,
semantic: true,
navigation: true,
structure: true,
format: false,
});
});
});
});
Domain
Dependencies
- ../../dist/core/astro2tsx.js
- ../../dist/core/parseJS.js
- node:assert
- node:test
Source
Frequently Asked Questions
What does parseJS.test.ts do?
parseJS.test.ts is a source file in the astro codebase, written in typescript. It belongs to the CoreAstro domain.
What does parseJS.test.ts depend on?
parseJS.test.ts imports 4 module(s): ../../dist/core/astro2tsx.js, ../../dist/core/parseJS.js, node:assert, node:test.
Where is parseJS.test.ts in the architecture?
parseJS.test.ts is located at packages/language-tools/language-server/test/units/parseJS.test.ts (domain: CoreAstro, directory: packages/language-tools/language-server/test/units).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free