Skip to content

compilation errors for primitive type assertions #167

@scizor666

Description

@scizor666

Support plan

  • is this issue currently blocking your project? (yes/no): no
  • is this issue affecting a production system? (yes/no): yes

Context

  • node version: v12.22.7
  • module version with issue: 8.0.4
  • last module version without issue: 8.03
  • environment (e.g. node, browser, native): node
  • used with (e.g. hapi application, another framework, standalone, ...):standalone
  • any other relevant information:

What are you trying to achieve or the steps to reproduce?

function foo(): number | undefined {
 //
}

const value = foo();
expect(value).to.be(123)

function bar(): boolean {
 //
}
expect(bar()).equals(false)

What was the result you got?

compilation errors like:

Argument of type '123' is not assignable to parameter of type 'never'
Argument of type 'false' is not assignable to parameter of type 'never' 

What result did you expect?

no compile error

Metadata

Metadata

Assignees

No one assigned

    Labels

    typesTypeScript type definitions

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions