create-codeql-query-unit-test-javascript

Automate creation and validation of JavaScript CodeQL unit tests.

30|3|Updated Feb 4, 2026
One-click install
npx skills add https://github.com/advanced-security/codeql-development-mcp-server --skill create-codeql-query-unit-test-javascript
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-codeql-query-unit-test-javascript
Source: https://github.com/advanced-security/codeql-development-mcp-server/tree/main/.github/skills/create-codeql-query-unit-test-javascript
Command: npx skills add https://github.com/advanced-security/codeql-development-mcp-server --skill create-codeql-query-unit-test-javascript

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Automates creation, validation, and maintenance of comprehensive JavaScript CodeQL unit tests using the MCP Server workflow, reducing manual setup and boosting test reliability.

Core Features & Use Cases

  • Structured test packs: standard directory layout including {QueryName}.qlref, Example1.js, and {QueryName}.expected for each query.
  • Guided test extraction: built-in steps to extract a test database and validate results with codeql_test_run and related MCP tools.
  • Framework support: supports ES5/ES6+ JavaScript and common test patterns across Node and browser contexts.

Quick Start

Create a JavaScript CodeQL unit-test package by adding a new skill directory with a .qlref, Example1.js, and an expected results file, then extract the test database.

Frequently Asked Questions about create-codeql-query-unit-test-javascript

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create JavaScript CodeQL unit tests for query development?

JavaScript CodeQL unit tests require a structured directory layout containing a {QueryName}.qlref file, an Example1.js test case, and a {QueryName}.expected file for verifying expected query results.

What is the standard directory structure for a CodeQL query test pack?

A standard CodeQL query test pack uses a directory layout that includes a {QueryName}.qlref file to reference the query, an Example1.js file as the test database source, and a {QueryName}.expected file listing anticipated alerts.

How do I extract a test database and validate CodeQL query results?

You extract a test database from your example JavaScript files and validate the query results by running the codeql_test_run command through the MCP Server workflow to compare actual alerts against the expected results file.

Does this CodeQL unit testing workflow support both Node.js and browser JavaScript?

Yes, this CodeQL unit testing workflow supports ES5/ES6+ JavaScript and handles common test patterns across both Node.js and browser environments for comprehensive query validation.

Can I automate CodeQL test maintenance and validation using an MCP Server?

Yes, you can automate CodeQL test maintenance and validation using the MCP Server workflow, which provides built-in steps for test database extraction and running codeql_test_run to verify expected results.