or run

npx @tessl/cli init
Log in

Version

Files

tile.json

task.mdevals/scenario-4/

Simple Testing Framework Plugin

Build a Karma plugin adapter for a hypothetical testing framework. Your plugin must register with Karma using the framework plugin pattern and automatically include the necessary framework files when initialized.

Requirements

Your plugin needs to:

  1. Register as a Karma framework plugin with the name 'simple-test'
  2. Use Karma's factory pattern to export the framework initialization function
  3. Automatically add framework files to Karma's file list when the plugin is loaded
  4. Configure file patterns with appropriate properties for Karma to serve and include them

The plugin should add two files when initialized:

  • A CSS file located at ./vendor/simple-test.css
  • A JavaScript library file located at ./vendor/simple-test.js

Implementation

@generates

Test Cases

  • The module exports an object with key 'framework:simple-test' @test
  • The framework registration uses a factory pattern with a two-element array @test
  • The initialization function has dependency injection configured for 'config.files' @test
  • When initialized, the function adds a CSS file pattern to the files array @test
  • When initialized, the function adds a JS file pattern to the files array @test
  • Each added file pattern has properties: pattern, included, served, and watched @test

API

/**
 * Main module export - registers the plugin with Karma
 */
module.exports = {
  'framework:simple-test': Array
};

Dependencies { .dependencies }

karma-qunit { .dependency }

Provides reference implementation patterns for creating Karma framework plugins, including plugin registration, factory pattern usage, and file injection mechanisms.

@satisfied-by