Skip to content

Only one describe block per module #5

Description

@BorePlusPlus

It seems that zUnit only runs the first test suite (aka describe block) in a module and ignores subsequent ones.

const { describe, it } = require("zunit");

describe("first", () => {
  it("tests");
});

describe("second", () => {
  it("tests");
});

gives following output when run

$ npx zunit

bar

  first
    tests 
     - SKIPPED: Pending (0ms)

Summary
  Tests: 1, Passed: 0, Failed: 0, Skipped: 1, Duration: 7ms

One or more tests were not run!

as a contrast mocha will run both

describe("first", () => {
  it("tests");
});

describe("second", () => {
  it("tests");
});

output

npx mocha                                                                                                                                                                 
                                                                                                         
                                                                                                         
  first                                                                                                  
    - tests                                  
                                                    
  second                                                                                                 
    - tests              
                                                    
                                                                                                         
  0 passing (2ms)                                   
  2 pending

Is this behaviour as designed or a bug? If it is deliberate, I would love to learn why.

Cheers

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions