Gathering detailed insights and metrics for chai-kekka
Gathering detailed insights and metrics for chai-kekka
Gathering detailed insights and metrics for chai-kekka
Gathering detailed insights and metrics for chai-kekka
npm install chai-kekka
Typescript
Module System
Node Version
NPM Version
TypeScript (60.76%)
JavaScript (39.24%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
ISC License
1 Stars
8 Commits
1 Watchers
1 Branches
1 Contributors
Updated on Oct 19, 2022
Latest Version
3.0.0
Package Id
chai-kekka@3.0.0
Unpacked Size
12.11 kB
Size
3.36 kB
File Count
11
NPM Version
8.11.0
Node Version
16.15.1
Published on
Aug 02, 2023
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
A Chai plugin for Kekka
Node: npm install --save-dev chai-kekka
to get up and running.
1const chai = require("chai") 2const chaiKekka = require("chai-kekka") 3 4chai.use(chaiKekka)
The result
property can be used to check that the tested value is an instance of the Result
class.
1expect(Success('Some String')).to.be.a.result 2expect(Failure(new Error('Failure...'))).to.be.a.result
The success
property can be used to check that the tested value is an instance of the Result
class of type Success
.
1// Positive 2expect(Success('Success String')).to.be.a.success // OK 3expect(Failure(new Error('Failure...'))).to.be.a.success // FAIL 4expect('Not a result').to.be.a.success // FAIL 5 6// Negative 7expect(Success('Success String')).not.to.be.a.success // FAIL 8expect(Failure(new Error('Failure...'))).not.to.be.a.success // OK 9expect('Not a result').not.to.be.a.success // FAIL with 'expected 'Not a result' to be an instance of Result'
The failure
property can be used to check that the tested value is an instance of the Result
class of type Failure
.
1// Positive 2expect(Success('Success String')).to.be.a.failure // FAIL 3expect(Failure(new Error('Failure...'))).to.be.a.failure // OK 4expect('Not a result').to.be.a.failure // FAIL 5 6// Negative 7expect(Success('Success String')).not.to.be.a.failure // OK 8expect(Failure(new Error('Failure...'))).not.to.be.a.failure // FAIL 9expect('Not a result').not.to.be.a.failure // FAIL with 'expected 'Not a result' to be an instance of Result'
There are two ways to test the associated value of a Result object:
successWrapping
and failureWrapping
associatedValue
successWrapping
and failureWrapping
1const error = new Error('Failure message') 2expect(Failure(error)).to.be.a.failureWrapping(error) // OK 3expect(Failure(error)).to.be.a.successWrapping(error) // FAIL - not a Success 4expect(Failure(error)).to.be.a.failureWrapping('some other value') // FAIL 5 6expect(Success('Success String')).to.be.a.successWrapping('Success String') // OK 7expect(Success('Success String')).to.be.a.failureWrapping('Success String') // Fail - not a Failure 8 9// equality modifiers can be used, such as deep, on successWrapping and failureWrapping 10expect(Success({ a: '423' })).to.be.a.deep.successWrapping({ a: '423' })
associatedValue
The associatedValue
property can be used after a result
, success
or failure
property.
It changes the target of any assertions that follow in the chain to be on the result associated value.
1expect(Success('Success String')).to.be.a.success 2 .with.associatedValue.that.equals('Success String') // OK 3expect(Success({ a: '423' })).to.be.a.success 4 .with.associatedValue.that.deep.equals({ a: '423' }) // OK - equality modifiers accepted 5expect(Success({ a: '423' })).to.be.a.failure 6 .with.associatedValue.that.deep.equals({ a: '423' }) // FAIL - not a failure 7expect(Success({ a: '423' })).to.be.a.result 8 .with.associatedValue.that.deep.equals({ a: '423' }) // OK 9expect(Success('Success String')).to.have.associatedValue.that.equals('Success String') // FAILS 10// associatedValue must be after either a result, success or failure assertion property
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
9 existing vulnerabilities detected
Details
Reason
Found 0/8 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-07-14
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More