Skip to content

Commit

Permalink
Bump chai from 4.3.10 to 5.0.0 (#481)
Browse files Browse the repository at this point in the history
* Bump chai from 4.3.10 to 5.0.0

Bumps [chai](https://github.com/chaijs/chai) from 4.3.10 to 5.0.0.
- [Release notes](https://github.com/chaijs/chai/releases)
- [Changelog](https://github.com/chaijs/chai/blob/main/History.md)
- [Commits](chaijs/chai@v4.3.10...v5.0.0)

---
updated-dependencies:
- dependency-name: chai
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* WIP: replace chai.expect with assert

* replaced chai.expect with assert

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Deepak Prabhakara <[email protected]>
  • Loading branch information
dependabot[bot] and deepakprabhakara authored Jan 3, 2024
1 parent d8efe38 commit 1f1549e
Show file tree
Hide file tree
Showing 16 changed files with 216 additions and 343 deletions.
154 changes: 0 additions & 154 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"@types/xml2js": "0.4.14",
"@typescript-eslint/eslint-plugin": "6.16.0",
"@typescript-eslint/parser": "6.16.0",
"chai": "4.3.10",
"eslint": "8.56.0",
"eslint-config-prettier": "9.1.0",
"mocha": "10.2.0",
Expand Down
8 changes: 4 additions & 4 deletions test/lib/cert.spec.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import assert from 'assert';
import { stripCertHeaderAndFooter, PubKeyInfo } from '../../lib/cert';
import { expect } from 'chai';

const certificate =
'MIICajCCAdOgAwIBAgIBADANBgkqhkiG9w0BAQ0FADBSMQswCQYDVQQGEwJ1czETMBEGA1UECAwKQ2FsaWZvcm5pYTEVMBMGA1UECgwMT25lbG9naW4gSW5jMRcwFQYDVQQDDA5zcC5leGFtcGxlLmNvbTAeFw0xNDA3MTcxNDEyNTZaFw0xNTA3MTcxNDEyNTZaMFIxCzAJBgNVBAYTAnVzMRMwEQYDVQQIDApDYWxpZm9ybmlhMRUwEwYDVQQKDAxPbmVsb2dpbiBJbmMxFzAVBgNVBAMMDnNwLmV4YW1wbGUuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDZx+ON4IUoIWxgukTb1tOiX3bMYzYQiwWPUNMp+Fq82xoNogso2bykZG0yiJm5o8zv/sd6pGouayMgkx/2FSOdc36T0jGbCHuRSbtia0PEzNIRtmViMrt3AeoWBidRXmZsxCNLwgIV6dn2WpuE5Az0bHgpZnQxTKFek0BMKU/d8wIDAQABo1AwTjAdBgNVHQ4EFgQUGHxYqZYyX7cTxKVODVgZwSTdCnwwHwYDVR0jBBgwFoAUGHxYqZYyX7cTxKVODVgZwSTdCnwwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQ0FAAOBgQByFOl+hMFICbd3DJfnp2Rgd/dqttsZG/tyhILWvErbio/DEe98mXpowhTkC04ENprOyXi7ZbUqiicF89uAGyt1oqgTUCD1VsLahqIcmrzgumNyTwLGWo17WDAa1/usDhetWAMhgzF/Cnf5ek0nK00m0YZGyc4LzgD0CROMASTWNg==';

describe('cert.ts', function () {
it('stripCertHeaderAndFooter ok', function () {
expect(stripCertHeaderAndFooter(certificate)).to.be.ok;
assert(stripCertHeaderAndFooter(certificate));
});
it('stripCertHeaderAndFooter not ok', function () {
expect(stripCertHeaderAndFooter('')).to.be.not.ok;
assert.strictEqual(stripCertHeaderAndFooter(''), '');
});

it('PubKeyInfo ok', function () {
let value = PubKeyInfo(certificate)({ prefix: '' });
value = value.replace('<X509Data><X509Certificate>', '');
value = value.replace('</X509Certificate</X509Data>', '');
expect(certificate).to.equal(value);
assert.strictEqual(value, certificate);
});
});
30 changes: 17 additions & 13 deletions test/lib/decrypt.response.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from 'assert';
import { validate } from '../../lib/response';
import { expect } from 'chai';
import fs from 'fs';

const oneLoginSamlResponseEncrypted = fs
Expand Down Expand Up @@ -31,9 +31,10 @@ describe('decrypt.response.spec', function () {
inResponseTo: oneLoginInResponseTo,
});

expect(oneLoginIssuerName).to.equal(response.issuer);
expect(oneLoginProfileClaims).to.equal(
response.claims['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier']
assert.strictEqual(response.issuer, oneLoginIssuerName);
assert.strictEqual(
response.claims['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier'],
oneLoginProfileClaims
);
});

Expand All @@ -44,9 +45,10 @@ describe('decrypt.response.spec', function () {
bypassExpiration: true,
inResponseTo: oneLoginInResponseTo,
});
expect(oneLoginIssuerName).to.equal(response.issuer);
expect(oneLoginProfileClaims).to.equal(
response.claims['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier']
assert.strictEqual(response.issuer, oneLoginIssuerName);
assert.strictEqual(
response.claims['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier'],
oneLoginProfileClaims
);
});

Expand All @@ -57,9 +59,10 @@ describe('decrypt.response.spec', function () {
bypassExpiration: true,
inResponseTo: oktaInResponseTo,
});
expect(oktaIssuerName).to.equal(response.issuer);
expect(oktaProfileClaims).to.equal(
response.claims['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier']
assert.strictEqual(response.issuer, oktaIssuerName);
assert.strictEqual(
response.claims['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier'],
oktaProfileClaims
);
});

Expand All @@ -70,9 +73,10 @@ describe('decrypt.response.spec', function () {
bypassExpiration: true,
inResponseTo: oktaInResponseTo,
});
expect(oktaIssuerName).to.equal(response.issuer);
expect(oktaProfileClaims).to.equal(
response.claims['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier']
assert.strictEqual(response.issuer, oktaIssuerName);
assert.strictEqual(
response.claims['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier'],
oktaProfileClaims
);
});
});
Loading

0 comments on commit 1f1549e

Please sign in to comment.