Skip to content

IDEA: implementation agnostic spec service / runnerΒ #451

@subtleGradient

Description

@subtleGradient

What is the problem this feature would solve?

GOAL: emotional certainty that our stuff works everywhere
PROBLEM: vitest / bun:test only run in node / bun
CONTEXT: so many js runtimes

  • ∞ versions of node
  • bun
  • deno
  • LynxJS has TWO js runtimes!
  • React Native web, ios, android, macOS, windows, Apple TV!!!
  • porfor?
  • the js runtime in ladybird browser
  • etc...

CONTEXT: many packages have platform / environment specific requirements / expectations

  • e.g. bun:sqlite on macOS requires setting a custom libsqlite or else you can't load extensions

What is the feature you are proposing to solve the problem?

three things

  1. some kind of Effect.Spec thing that's like @effect/vitest, but without the vitest dependency
  2. implementation agnostic spec runner
  3. push the community to adopt Effect.Service level specs

in other words, @effect/platform should define a suite of specs that must pass for any/all @effect/platform-* packages. And there should be a thing that runs all the specs in all the runtimes. ALL THE JS RUNTIMES!!!1!

Image

what js runtimes tho?

  • miniflare & wrangler
  • react native

What alternatives have you considered?

  • created a package that is like @effect/vitest, but for bun:test
  • could create integration tests for each mobile platform

honestly, ain't nobody gonna do all that for EVERY platform. too hard.


back in the ol' mootools days we would run all our tests across all real browsers
at Sencha we also ran the same test suite against all the different rendering MODES of each browser.

Nowadays with native dependencies I want to run my native tests in react native web, ios, android, macOS, windows, LynxJS, nativescript macOS, nativescript ios, etc etc etc
Need to test against x86 and aarch, darwin and linux to verify that all my native dependencies are wired up properly and everything.


I want to define a set of service specs that every specific layer implementation of that service must pass.
back in ~2010 I loved having implementation agnostic specs with multiple implementations. then we could run the same specs against each implementation to verify that they conform to specs

example of how I ran the same implementation agnostic test suite against both the document.styleSheets api and Sheet.js
https://github.com/subtleGradient/Sheet.js/blob/develop/Test/document.styleSheets.test.js
https://github.com/subtleGradient/Sheet.js/blob/develop/Test/Sheet.test.js

yes, I'm old

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions