Giter Club home page Giter Club logo

Comments (5)

JeffRMoore avatar JeffRMoore commented on May 4, 2024

How do folks feel about converting to jest?

from compose.

PlasmaPower avatar PlasmaPower commented on May 4, 2024

Sounds good, we should probably wrap that into the PR for reorganizing tests. I'll change the issue to include both.

from compose.

JeffRMoore avatar JeffRMoore commented on May 4, 2024

I have a version of the test suite in jest with 100% coverage that I've been using for experimentation. (Love watch). Its based on the skip-next branch and I added flow support and semi-colons with prettier. I need to clean it up and reformat it back. I'm prepping an update to skip-next. I'll work on submitting the suite back after that. This is the organization I used:

  compose
    ✓ should throw if middleware doesn not return a promise
    ✓ should keep the context across multiple middleware (1ms)
    ✓ should reject on errors in middleware (2ms)
    ✓ should not call next with middleware parameters
    ✓ should not call skipNext with middleware parameters (1ms)
    ✓ should throw if skipNext() is called multiple times at the beginning
    ✓ should throw if next() is called multiple times at the beginning (1ms)
    ✓ should throw if skipNext() is called multiple times at the end
    ✓ should throw if next() is called multiple times at the end
    ✓ should throw if skipNext() is called after next() (1ms)
    ✓ should throw if next() is called after skipNext()
    empty stack
      ✓ should propagate the return value of calling next (2ms)
      ✓ should catch an exception in next (1ms)
      ✓ should catch a rejected promise in next (1ms)
      ✓ should only accept functions for next
      ✓ should only accept functions for skipNext
    parameters
      ✓ should only accept an array of middleware
      ✓ should only accept middleware as functions (1ms)
    deep stack
      ✓ should call middleware stack in the right order (1ms)
      ✓ should be able to be called twice (1ms)
      ✓ should propagate the value of calling next
      with Skip at the end
        ✓ should propagate the value of calling skipNext
        ✓ should catch an exception in skipNext (1ms)
        ✓ should catch a rejected promise in skipNext

I haven't worked on any sort of CI integration for coverage or failures.

from compose.

PlasmaPower avatar PlasmaPower commented on May 4, 2024

Looks good! Reliant on skipNext though, and nothing against it but I don't think it'll get merged (presumably breaking change after koa@2 finalized).

from compose.

jonathanong avatar jonathanong commented on May 4, 2024

oh wow i did this #90

removing the top-level describe isn't worth the git diff imo, i'd rather just put all new tests in a new file

from compose.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.