Skip to content

Commit e19165e

Browse files
authored
Merge pull request #20 from slowli/update-deps
Update dependencies
2 parents 053d1f8 + 076f9b4 commit e19165e

File tree

8 files changed

+2232
-4090
lines changed

8 files changed

+2232
-4090
lines changed

.github/dependabot.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: npm
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
time: "03:00"
8+
open-pull-requests-limit: 10
9+
assignees:
10+
- slowli
11+
ignore:
12+
- dependency-name: "*"
13+
update-types: ["version-update:semver-patch"]

.github/workflows/nodejs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
strategy:
1414
matrix:
15-
node-version: [10.x, 12.x, 14.x]
15+
node-version: [10.x, 12.x, 14.x, 16.x]
1616

1717
steps:
1818
- uses: actions/checkout@v2
@@ -26,9 +26,9 @@ jobs:
2626
env:
2727
CI: true
2828
- run: npm run test-ts
29-
- run: npm run coverage
29+
- run: npm run test-browser
3030
- name: Coveralls
3131
uses: coverallsapp/github-action@master
32-
if: success() && startsWith(matrix.node-version, '12')
32+
if: success() && startsWith(matrix.node-version, '14')
3333
with:
3434
github-token: ${{ secrets.GITHUB_TOKEN }}

index.d.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,30 @@
33
declare global {
44
namespace Chai {
55
interface Assertion extends LanguageChains, NumericComparison, TypeComparison {
6+
/**
7+
* Compares byte arrays on per-element basis.
8+
*
9+
* @param bytes Expected bytes encoded as a hex string or an array-like object
10+
*
11+
* @example
12+
* expect(new Uint8Array([1, 2])).to.equalBytes([1, 2]);
13+
* expect(new Uint8Array[65, 66, 67])).to.equalBytes('414243');
14+
*/
615
equalBytes(bytes: string | ArrayLike<number>): Assertion;
716
}
817

918
interface Assert {
19+
/**
20+
* Compares byte arrays on per-element basis.
21+
*
22+
* @param buffer Actual byte buffer
23+
* @param bytes Expected bytes encoded as a hex string or an array-like object
24+
* @param msg Error message conforming to Chai spec
25+
*
26+
* @example
27+
* Assert.equalBytes(new Uint8Array(3), [0, 0, 0]);
28+
* Assert.equalBytes(new Uint8Array(2), '0000');
29+
*/
1030
equalBytes(buffer: Uint8Array, bytes: string | ArrayLike<number>, msg?: string): void;
1131
}
1232
}

index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ function every (buffer, predicate) {
44
if (Uint8Array && Uint8Array.prototype.every) {
55
return buffer.every(predicate);
66
} else {
7-
for (var i = 0; i < buffer.length; i++) {
7+
for (let i = 0; i < buffer.length; i++) {
88
if (!predicate(buffer[i], i, buffer)) {
99
return false;
1010
}
@@ -21,7 +21,7 @@ function every (buffer, predicate) {
2121
* expect(new Uint8Array[65, 66, 67])).to.equalBytes('414243');
2222
*/
2323
module.exports = function (chai) {
24-
var Assertion = chai.Assertion;
24+
const Assertion = chai.Assertion;
2525

2626
Assertion.addMethod('equalBytes', function (expected) {
2727
if (typeof expected === 'string') {
@@ -32,10 +32,10 @@ module.exports = function (chai) {
3232
throw new TypeError('equalBytes consumes string, array, or array-like object; got none of those');
3333
}
3434

35-
var actual = this._obj;
35+
const actual = this._obj;
3636
new Assertion(actual).to.be.a('uint8array');
3737

38-
var assert;
38+
let assert;
3939
if (typeof expected === 'string') {
4040
// expected value is a hex string
4141
assert = expected.length === actual.length * 2 &&

karma.conf.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module.exports = function (config) {
2222
colors: true,
2323
logLevel: config.LOG_INFO,
2424
autoWatch: false,
25-
browsers: ['FirefoxHeadless', 'PhantomJS'],
25+
browsers: ['FirefoxHeadless'],
2626
browserNoActivityTimeout: 30000,
2727
singleRun: true,
2828
concurrency: Infinity,
@@ -32,8 +32,8 @@ module.exports = function (config) {
3232
{
3333
type: 'lcovonly',
3434
dir: 'coverage',
35-
subdir: function (browser) {
36-
return browser.toLowerCase().split(/[ /-]/)[0];
35+
subdir: function () {
36+
return '.'; // we need to have a single report directly in the `coverage` dir
3737
}
3838
},
3939
{ type: 'text-summary' }

0 commit comments

Comments
 (0)