node-compat

Разбор тестов совместимости Deno с Node.js

denoland/denoОт разработчика платформы
108 745звёзд6 442форковУ всего репозитория

Что получите

Исправление реализации либо обновлённая настройка теста с конкретной причиной исключения или ожидаемого сбоя.

Что передать

Имя теста совместимости в репозитории Deno.

Автопроверка файлов

Проверен состав файлов. Запуск не тестировался. Что проверено

Оценки пользователей

Загрузка оценок…
Ваш опыт
Обсудить →

Как использовать

Помогает разработчикам Deno разобраться с конкретным тестом совместимости Node.js. Определяет, нужно ли исправить реализацию, пропустить тест на отдельной платформе или исключить его с объяснением.

  1. Укажите тест для сборки и запуска.
  2. При сбое попросите сопоставить ошибку с ожидаемым поведением Node.js и реализацией Deno.
  3. Выберите исправление или обоснованное изменение настройки теста, затем повторите запуск.

Условия работы

  • Предназначен для тестов совместимости внутри исходного проекта Deno.
  • После изменения реализации обязательна повторная сборка: без неё изменения не вступят в силу.
  • Принципиально неподдерживаемые особенности Node.js допускают исключение теста; причина обязательна.

Пример запроса после установки

Разбери указанный тест совместимости Deno с Node.js: выясни причину сбоя и предложи исправление реализации либо обоснованное исключение теста.

Пример составлен по инструкции автора; результат запуска не проверялся.

Основание: инструкция закреплённой версии

Для установки

Node.js, npm и Git для команды выше. Подключения и инструменты для работы скилла настраиваются отдельно.

Совместимые агенты

Совместимость указана для инструкций. Запуск в каждом приложении не тестировался; для веб-чата способ подключения может отличаться.

Файлы скилла

GitHub
Читать инструкцию SKILL.md

Исходный текст закреплённой версии.

---
name: node-compat
description: Run a Node.js compatibility test, diagnose failures, and either fix the implementation, skip, or ignore the test. Use when asked to work on node compat tests.
argument-hint: <test-name>
allowed-tools: Bash Read Write Edit Glob Grep Agent
---

# Node Compat Test

Work on Node.js compatibility test `$ARGUMENTS`.

## Step 1: Build and run the test

```sh
./x build
./x test-compat $ARGUMENTS
```

If the test passes, report success and ensure test is specified in
`tests/node_compat/config.jsonc`.

## Step 2: Diagnose the failure

Read the test file to understand what it tests:

```sh
# Tests live under tests/node_compat/test/
```

Use `Grep` and `Read` to find the test source, then analyze:

1. **What Node.js API or behavior is being tested?**
2. **What is the actual error or assertion failure?**
3. **Where is the relevant Deno implementation?** Check `ext/node/` (polyfills,
   ops, internal bindings), `runtime/`, or `cli/`.

Read the corresponding Node.js docs and/or source code to understand the
expected behavior.

## Step 3: Classify the failure

Determine which category this failure falls into:

### A. Fixable bug

The Deno implementation is wrong or incomplete, but can be corrected. This
includes:

- Missing method/property on a polyfill
- Wrong return value or error type
- Missing event emission
- Incorrect argument handling
- Hard-to-fix but still fundamentally implementable behaviors

**Action:** Fix the implementation (Step 4).

### B. Inherent incompatibility

The test relies on Node.js internals or architecture that Deno fundamentally
cannot or will not support:

- `internalBinding()` calls to Node's C++ layer
- Node.js-specific CLI flags (`--inspect`, `--prof`, etc.)
- V8 internals exposed through Node-specific APIs
- Node.js-specific build/addon tooling (node-gyp internals)
- Tests for Node.js's own test infrastructure

**Action:** Ignore the test with a reason (Step 5).

### C. Not worth fixing

The test exercises an edge case or behavior that is technically possible but
provides negligible value:

- Extremely obscure error message wording differences
- Node.js-specific deprecation warnings
- Behavior that no real-world code depends on

**Action:** Ignore or skip the test with a reason (Step 5).

## Step 4: Fix the implementation

If the failure is fixable:

1. Locate the relevant code in `ext/node/` (or elsewhere).
2. Implement the fix. Match Node.js behavior - check Node.js docs and/or source
   code, not just what "seems right."
3. Use lazy-loaded imports where possible.
4. Use primordials for internal JS code to avoid prototype pollution.
5. Rebuild the source code with `./x build` - this is paramount, changes won't
   take effect until you do.
6. Re-run the test to verify the fix:

```sh
./x test-compat $ARGUMENTS
```

6. Once the test passes, make sure the test is listed in
   `tests/node_compat/config.jsonc` with an empty config:

```jsonc
"category/test-name.js": {}
```

The entries in `config.jsonc` are sorted alphabetically within their category.
Place the new entry in the correct position.

## Step 5: Skip or ignore the test

If the test cannot or should not be fixed, update
`tests/node_compat/config.jsonc`.

### Ignore (test should never run — inherent incompatibility)

```jsonc
"category/test-name.js": {
  "ignore": true,
  "reason": "Brief, specific explanation of why this can't work in Deno"
}
```

`"reason"` must be specified otherwise the lint step will fail!

### Platform-specific skip

If the test only fails on certain platforms:

```jsonc
"category/test-name.js": {
  "windows": false
}
```

### Expected failure (test runs but fails with known output)

If you want the test to run but expect a specific failure:

```jsonc
"category/test-name.js": {
  "exitCode": 1,
  "output": "[WILDCARD]specific error message[WILDCARD]",
  "reason": "Brief explanation of why this fails"
}
```

This is a good middle ground for tests that are generally compatible but have a
specific known issue. If a fix is ever done this assertion will notify the
implementer to update the config.

### Writing good reasons

Reasons should be specific and actionable. Good examples:

- "Tests Node.js internal C++ binding (internalBinding('zlib').Zlib) which is
  not implemented in Deno"
- "requires `deno --interactive` flag (not yet implemented)"
- "URL.createObjectURL does not throw ERR_INVALID_ARG_TYPE for non-Blob
  arguments"

Bad examples:

- "Not supported" (too vague)
- "Doesn't work" (says nothing)
- "Node-specific" (which part?)

## Step 6: Verify

Re-run the test one final time to confirm the outcome matches expectations:

```sh
./x test-compat $ARGUMENTS
```

## Config reference

The full schema for `config.jsonc` entries is in
`tests/node_compat/schema.json`.

## PR title conventions

When opening a PR for node-compat work, use the appropriate prefix:

- `test:` — when the PR only updates `tests/node_compat/config.jsonc` to skip,
  ignore, or otherwise reclassify tests without changing implementation code.
- `fix(ext/node):` — when the PR actually fixes the implementation so a
  previously failing test now passes (typically changes under `ext/node/` plus
  enabling the test in `config.jsonc`).

Проверка и особенности

Автоматическая проверка источника и файлов

Автоматически проверены публичный репозиторий, лицензия, заголовок SKILL.md, состав текстового пакета и Git-хеш каждого файла. Пакеты с исполняемым кодом и срабатываниями применённых статических правил не включены. Ручной аудит всех инструкций и функциональный запуск не проводились. Внешние инструменты и сервисы не проверялись. Проверка не гарантирует безопасность.

У репозитория было 108,539 звёзд GitHub при проверке 2026-09-27. Порог добавления — строго больше 100 000. Звёзды относятся ко всему репозиторию, а не к качеству или установкам скилла.

Проверка состава
27.09.2026
Проверенная версия
b157cd27e153
Файлы с кодом
Не указаны в данных проверки
Изменения на GitHub
Нужна повторная проверкаПоследняя проверка: 11.10.2026
Как мы проверяем скиллы

Репозиторий и лицензия

denoland/deno
108 745 звёзд6 442 форков

Это показатели всего репозитория, а не установки скилла. Снимок требует обновления.

Последняя активность GitHub
07.10.2026
Лицензия
MIT
Добавлен в каталог
27.09.2026
Полный текст лицензии
MIT License

Copyright 2018-2026 the Deno authors

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Ещё в этой категории

Все в категории

Обсуждение

Правила

Пользовались этим скиллом? Делитесь опытом без регистрации. Все комментарии проверяет модератор.

Мои комментарии