Ctrl + K
DocumentationLog inGet started

tessl/npm-jest-circus

tessl install tessl/npm-jest-circus@29.7.0

The next-gen flux-based test runner for Jest that provides test framework globals and event-driven test execution

Agent Success

Agent success rate when using this tile

82%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.91x

Baseline

Agent success rate without this tile

43%

task.mdevals/scenario-2/

Test Suite for Configuration Comparison

Goal

Write a comprehensive test suite that validates different equality comparison scenarios for configuration objects. Your tests should demonstrate understanding of when to use different types of equality checks.

Background

A configuration management system needs to validate user settings. Different scenarios require different types of equality checks: some need to verify reference identity, others need deep value comparison, and some need strict type checking.

Requirements

1. Helper Functions

Implement three simple comparison functions in src/compare.js:

  • isSameReference(a, b) - Returns true if both arguments reference the exact same value
  • isDeepEqual(a, b) - Returns true if values have the same structure and content
  • isStrictEqual(a, b) - Returns true if values are equal with strict type checking

These functions can use built-in JavaScript comparison (you don't need to implement custom deep equality logic).

2. Test Suite

Create a comprehensive test suite in src/compare.test.js that tests these comparison functions with various inputs. Your test suite should cover:

Reference Identity Tests

  • Primitive values with the same value
  • Same object referenced by two variables
  • Different objects with identical content

Deep Equality Tests

  • Objects with the same properties and values
  • Nested objects with matching structure
  • Arrays with the same elements
  • Objects with different values

Strict Equality Tests

  • Sparse arrays (arrays with empty slots) vs arrays with explicit undefined values
  • Objects with undefined properties vs objects without those properties

3. Required Test Cases

Test Case 1: Primitive Values { .test }

  • Input: Compare number 42 with number 42
  • Expected: Reference identity check passes

Test Case 2: Same Object Reference { .test }

  • Input: const obj = {name: "test"}; compare obj with itself
  • Expected: Reference identity check passes

Test Case 3: Different Object References { .test }

  • Input: Compare {id: 1, name: "user"} with a new object {id: 1, name: "user"}
  • Expected: Deep equality check passes, but reference identity check fails

Test Case 4: Sparse vs Dense Arrays { .test }

  • Input: Compare [1, , 3] (sparse) with [1, undefined, 3] (dense)
  • Expected: Strict equality check fails

Dependencies { .dependencies }

jest-circus { .dependency }

Provides testing framework and assertion matchers for validating the configuration validator behavior.

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
npmpkg:npm/jest-circus@29.7.x
tile.json