{"id":12846,"library":"atom-grammar-test","title":"Atom Grammar Testing Framework","description":"atom-grammar-test is a testing framework designed specifically for Atom editor grammar definitions, inspired by Sublime Text's syntax testing format. It allows developers to define grammar fixtures directly within source code comments, visually annotating how grammar rules should parse different code constructs. This enables both programmatic testing and visual inspection of grammar behavior. The current stable version is 0.6.4. Given that the Atom editor has been officially archived and is no longer maintained, this package is effectively abandoned, with no active development or release cadence. Its primary differentiator was its tight integration with the Atom ecosystem and its visual testing approach.","status":"abandoned","version":"0.6.4","language":"javascript","source_language":"en","source_url":"https://github.com/kevinastone/atom-grammar-test","tags":["javascript"],"install":[{"cmd":"npm install atom-grammar-test","lang":"bash","label":"npm"},{"cmd":"yarn add atom-grammar-test","lang":"bash","label":"yarn"},{"cmd":"pnpm add atom-grammar-test","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Runtime dependency for the Atom editor environment, specifically requiring Atom >=1.0.0 <2.0.0. The package leverages Atom's built-in Jasmine 1.3 for testing.","package":"atom","optional":false}],"imports":[{"note":"This package primarily uses CommonJS `require` syntax, as it was designed for the Atom editor's environment, which often used CommonJS for package development.","wrong":"import grammarTest from 'atom-grammar-test';","symbol":"grammarTest","correct":"const grammarTest = require('atom-grammar-test');"}],"quickstart":{"code":"const grammarTest = require('atom-grammar-test');\nconst path = require('path');\n\ndescribe('My Custom Grammar', () => {\n\n  beforeEach(() => {\n    // Ensure your language package is loaded\n    // In Atom, this is typically an asynchronous operation.\n    // WaitsForPromise is an Atom-specific Jasmine helper.\n    waitsForPromise(() => {\n      // Replace 'language-my-grammar' with your actual Atom package name\n      return atom.packages.activatePackage('language-c');\n    });\n  });\n\n  // Point to a grammar test file. This file would contain inline syntax assertions.\n  // Example: 'test-fixtures/c-grammar-test.c'\n  grammarTest(path.join(__dirname, 'test-fixtures', 'c-grammar-test.c'));\n\n  // A dummy test file for illustration, replace with actual path:\n  // You would create 'test-fixtures/c-grammar-test.c' with content like:\n  /*\n  // SYNTAX TEST \"source.c\"\n  #pragma once\n  // <- punctuation.definition.directive meta.preprocessor.c\n  int main() {\n  // <- storage.type\n  //    ^ meta.function entity.name.function\n    return 0;\n  //  ^^^^^^ keyword.control\n  }\n  */\n});","lang":"javascript","description":"Demonstrates how to integrate `atom-grammar-test` into an Atom package's Jasmine test suite to test a custom grammar definition."},"warnings":[{"fix":"Migrate your grammar testing to a different editor platform (e.g., VS Code) and use a testing solution compatible with that platform.","message":"The Atom editor, which this package depends on, was officially archived by GitHub on December 15, 2022. This means atom-grammar-test is no longer functional in a supported environment.","severity":"breaking","affected_versions":">=0.1.0"},{"fix":"Ensure you are developing an Atom package and running tests within the Atom test environment. For other environments, a different testing tool is required.","message":"This package is designed exclusively for testing Atom grammar packages and relies heavily on Atom's internal APIs and Jasmine 1.3 test runner. It cannot be used outside the Atom ecosystem.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"No direct fix as the package is abandoned. If it were active, an update to include ESM exports would be necessary.","message":"The package uses a CommonJS `require` pattern and does not provide ESM exports. While Atom's environment typically supported CommonJS, modern JavaScript development often favors ESM.","severity":"deprecated","affected_versions":"<=0.6.4"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Ensure your tests are executed using Atom's `atom --test` command or through its built-in test runner for packages.","cause":"The test suite is being run outside of the Atom editor's test environment.","error":"ReferenceError: atom is not defined"},{"fix":"Verify that your `beforeEach` block properly waits for Atom's packages to activate using `waitsForPromise` (or equivalent asynchronous handling in a modern Jasmine setup) and that the test environment is correctly set up.","cause":"The `atom.packages` object is not available, likely because Atom's environment hasn't fully loaded or the test runner isn't properly initialized.","error":"TypeError: Cannot read property 'activatePackage' of undefined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null}