{"id":14328,"library":"web-test-runner-jasmine","title":"Web Test Runner Jasmine Plugin","description":"web-test-runner-jasmine is a plugin designed to integrate the Jasmine testing framework with the Web Test Runner environment, enabling browser-based testing of JavaScript and TypeScript applications using Jasmine's familiar syntax and assertion style. The current stable version is 0.2.0, released recently with fixes for error reporting and logging. While not having a strict release cadence, it receives updates as part of the broader @web ecosystem. Its primary utility lies in providing the `jasmineTestRunnerConfig` function, which simplifies the configuration of Web Test Runner to use Jasmine, handling the necessary setup for running Jasmine specs in a browser context. This package differentiates itself by offering a straightforward way to leverage Jasmine within a modern, browser-centric testing workflow, contrasting with solutions primarily focused on Node.js or older browser environments. It works seamlessly with tools like @web/dev-server-esbuild for TypeScript compilation and @web/test-runner-playwright for browser launching.","status":"active","version":"0.2.0","language":"javascript","source_language":"en","source_url":"https://github.com/blueprintui/web-test-runner-jasmine","tags":["javascript"],"install":[{"cmd":"npm install web-test-runner-jasmine","lang":"bash","label":"npm"},{"cmd":"yarn add web-test-runner-jasmine","lang":"bash","label":"yarn"},{"cmd":"pnpm add web-test-runner-jasmine","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required peer dependency for Jasmine functionality.","package":"jasmine-core","optional":false}],"imports":[{"note":"Web Test Runner configurations primarily use ESM, so `import` syntax in `.mjs` or TypeScript is expected.","wrong":"const { jasmineTestRunnerConfig } = require('web-test-runner-jasmine');","symbol":"jasmineTestRunnerConfig","correct":"import { jasmineTestRunnerConfig } from 'web-test-runner-jasmine';"}],"quickstart":{"code":"import { playwrightLauncher } from '@web/test-runner-playwright';\nimport { esbuildPlugin } from '@web/dev-server-esbuild';\nimport { jasmineTestRunnerConfig } from 'web-test-runner-jasmine';\n\n// web-test-runner.config.mjs\nexport default /** @type {import(\"@web/test-runner\").TestRunnerConfig} */ ({\n  ...jasmineTestRunnerConfig(),\n  testFramework: {\n    config: {\n      defaultTimeoutInterval: 5000\n    },\n  },\n  nodeResolve: true,\n  files: ['./src/*.spec.js'],\n  browsers: [playwrightLauncher({ product: 'chromium' })],\n  plugins: [esbuildPlugin({ target: 'auto', sourceMap: true })]\n});\n\n// src/my-component.spec.js\ndescribe('a test suite', () => {\n  let element;\n\n  beforeEach(() => {\n    element = document.createElement('p');\n    element.innerHTML = 'hello there';\n  });\n\n  afterEach(() => {\n    element.remove();\n  });\n\n  it('should create element', () => {\n    expect(element.innerHTML).toBe('hello there');\n  });\n});","lang":"javascript","description":"This configuration sets up Web Test Runner to use Jasmine, launches a Chromium browser via Playwright, and defines a basic Jasmine test suite for a DOM element."},"warnings":[{"fix":"Upgrade your Node.js environment to version 24.0.0 or newer. Consider using a Node.js version manager like `nvm` or `volta`.","message":"The package requires Node.js version 24.0.0 or higher. Older Node.js versions are not supported and will result in errors.","severity":"breaking","affected_versions":">=0.1.0"},{"fix":"Install `jasmine-core` alongside `web-test-runner-jasmine`: `npm install --save-dev jasmine-core` or `yarn add -D jasmine-core`.","message":"This package has a peer dependency on `jasmine-core`. You must install `jasmine-core` separately in your project for `web-test-runner-jasmine` to function correctly.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Install `@types/jasmine`: `npm install --save-dev @types/jasmine`. Then, in `tsconfig.json`, add `\"types\": [\"jasmine\"]` under `compilerOptions`. Finally, update `esbuildPlugin({ ts: true, ... })` in your `web-test-runner.config.mjs`.","message":"For TypeScript projects, you need to install `@types/jasmine` and configure your `tsconfig.json` to include `jasmine` in the `types` array. Additionally, ensure `esbuildPlugin` is configured with `ts: true`.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"search_vec":"'0.2.0':50 'applic':36 'assert':43 'base':30 'broader':74 'browser':29,107,125,138,153 'browser-bas':28 'browser-centr':124 'cadenc':66 'centric':126 'compil':149 'configur':89 'context':108 'contrast':129 'current':46 'design':14 'differenti':111 'ecosystem':76 'enabl':27 'environ':26,139 'error':56 'familiar':40 'fix':54 'focus':133 'framework':20 'function':85 'handl':97 'integr':16 'jasmin':4,10,18,38,96,103,120 'jasminetestrunnerconfig':84 'javascript':33,155 'launch':154 'leverag':119 'lie':80 'like':145 'log':59 'modern':123 'necessari':99 'node.js':135 'offer':114 'older':137 'packag':110 'part':71 'plugin':5,13 'primari':78 'primarili':132 'provid':82 'receiv':68 'recent':52 'releas':51,65 'report':57 'run':102 'runner':3,9,25,93 'seamless':142 'setup':100 'simplifi':87 'solut':131 'spec':104 'stabl':47 'straightforward':116 'strict':64 'style':44 'syntax':41 'test':2,8,19,24,31,92,127 'tool':144 'typescript':35,148 'updat':69 'use':37,95 'util':79 'version':48 'way':117 'web':1,7,23,75,91 'web-test-runner-jasmin':6 'web/dev-server-esbuild':146 'web/test-runner-playwright':151 'within':121 'work':141 'workflow':128","created_at":"2026-04-20T01:59:08.500611+00:00","updated_at":"2026-04-20T01:59:08.500611+00:00","problems":[{"fix":"Ensure `jasmine-core` is installed, `web-test-runner-jasmine` is configured correctly in `web-test-runner.config.mjs`, and for TypeScript, `types: [\"jasmine\"]` is present in `tsconfig.json` and `@types/jasmine` is installed.","cause":"Jasmine global test functions (`describe`, `it`, `expect`) are not correctly exposed in the test environment, typically due to incorrect Web Test Runner or TypeScript configuration.","error":"ReferenceError: describe is not defined"},{"fix":"Verify that your `web-test-runner.config` file uses the `.mjs` extension (e.g., `web-test-runner.config.mjs`) for ESM imports and that `nodeResolve: true` is set in your config.","cause":"Web Test Runner is attempting to import the package using CommonJS `require()` or cannot find the module in an ESM context, or the `web-test-runner.config.mjs` file extension is incorrect.","error":"Error: Could not resolve \"web-test-runner-jasmine\" from ..."},{"fix":"Install `jasmine-core` as a development dependency: `npm install --save-dev jasmine-core` or `yarn add -D jasmine-core`.","cause":"The peer dependency `jasmine-core` is missing from the project's `node_modules`.","error":"Error: Cannot find package 'jasmine-core' imported from ..."}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/blueprintui/web-test-runner-jasmine","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/web-test-runner-jasmine","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-18","install_tag":null}}