Skip to content

Only one describe block per module #5

@BorePlusPlus

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

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