-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #78 from slowli/dependabot/npm_and_yarn/chai-5.0.0
Update `chai` peer dependency to 5.0.3
- Loading branch information
Showing
15 changed files
with
5,618 additions
and
5,027 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/** | ||
* Tests with `chai` v4 and CommonJS import. | ||
*/ | ||
const chai = require('chai'); | ||
const { expect, assert } = chai.use(require('chai-bytes')); | ||
|
||
const buffer = Uint8Array.from([1, 2, 3]); | ||
|
||
// Check `expect` behavior. | ||
expect(buffer).to.equalBytes([1, 2, 3]); | ||
expect(buffer).to.equalBytes('010203'); | ||
expect(buffer).to.equalBytes(Uint8Array.from([1, 2, 3])); | ||
// Check chaining | ||
expect(buffer).to.not.equalBytes('0102'); | ||
buffer[2] += 1; | ||
expect(buffer).to.have.lengthOf(3).and.equalBytes([1, 2, 4]); | ||
|
||
// Check `assert` behavior. | ||
buffer[2] -= 1; | ||
assert.equalBytes(buffer, [1, 2, 3], 'some message'); | ||
assert.equalBytes(buffer, '010203'); | ||
assert.equalBytes(buffer, Uint8Array.from([1, 2, 3])); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** | ||
* Tests with `chai` v5 and ES module import. | ||
*/ | ||
import * as chai from 'chai5'; | ||
import chaiBytes from 'chai-bytes'; | ||
|
||
const { expect, assert } = chai.use(chaiBytes); | ||
const buffer = Uint8Array.from([1, 2, 3]); | ||
|
||
// Check `expect` behavior. | ||
expect(buffer).to.equalBytes([1, 2, 3]); | ||
expect(buffer).to.equalBytes('010203'); | ||
expect(buffer).to.equalBytes(Uint8Array.from([1, 2, 3])); | ||
// Check chaining | ||
expect(buffer).to.not.equalBytes('0102'); | ||
buffer[2] += 1; | ||
expect(buffer).to.have.lengthOf(3).and.equalBytes([1, 2, 4]); | ||
|
||
// Check `assert` behavior. | ||
buffer[2] -= 1; | ||
assert.equalBytes(buffer, [1, 2, 3], 'some message'); | ||
assert.equalBytes(buffer, '010203'); | ||
assert.equalBytes(buffer, Uint8Array.from([1, 2, 3])); |
Oops, something went wrong.