Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump: [#4684] Upgrade chai using import-sync for esm-only package #4792

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .depcheckrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ignores: ["filenamify", "mocha", "rimraf", "sinon", "uuid"]
ignores: ["chai", "filenamify", "mocha", "rimraf", "sinon", "uuid"]
ignorePatterns: [".eslintrc.json", "lib"]
2 changes: 1 addition & 1 deletion libraries/botbuilder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"zod": "^3.23.8"
},
"devDependencies": {
"chai": "^4.5.0",
"chai": "^5.1.2",
"lodash": "^4.17.20",
"nock": "^13.5.5",
"node-mocks-http": "^1.16.0"
Expand Down
3 changes: 2 additions & 1 deletion libraries/botbuilder/tests/cloudAdapter.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
const assert = require('assert');
const httpMocks = require('node-mocks-http');
const net = require('net');
const { expect } = require('chai');
const importSync= require('import-sync');
const { expect } = importSync('chai/lib/chai');
const sinon = require('sinon');
const {
AuthenticationConfiguration,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const assert = require('assert');
const { Socket } = require('net');

const { expect } = require('chai');
const importSync= require('import-sync');
const { expect } = importSync('chai/lib/chai');
const { spy } = require('sinon');
const { ActivityHandler, ActivityTypes, StatusCodes, TurnContext } = require('botbuilder-core');

Expand Down
3 changes: 2 additions & 1 deletion libraries/botframework-streaming/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@
"@types/node": "18.19.47",
"@types/ws": "^6.0.3",
"eslint-plugin-only-warn": "^1.1.0",
"import-sync": "^2.2.2",
"uuid": "^10.0.0",
"ws": "^7.5.10"
},
"devDependencies": {
"chai": "^4.5.0"
"chai": "^5.1.2"
},
"scripts": {
"build": "npm-run-all -p build:lib build:browser",
Expand Down
3 changes: 2 additions & 1 deletion libraries/botframework-streaming/tests/Assembler.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
const { SubscribableStream } = require('../lib/subscribableStream');
const { PayloadAssemblerManager, PayloadTypes, StreamManager } = require('../lib/payloads');
const { PayloadAssembler } = require('../lib/assemblers');
const { expect } = require('chai');
const importSync= require('import-sync');
const { expect } = importSync('chai/lib/chai');

const streamManager = new StreamManager();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ const { PayloadAssembler } = require('../lib/assemblers');
const { PayloadTypes } = require('../lib/payloads/payloadTypes');
const { StreamManager } = require('../lib/payloads/streamManager');
const { SubscribableStream } = require('../lib/subscribableStream');
const { expect } = require('chai');
const importSync= require('import-sync');
const { expect } = importSync('chai/lib/chai');

class TestPayloadAssembler {
constructor(content) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ const { HttpContentStream } = require('../lib/httpContentStream');
const { HttpContent, StreamingRequest, SubscribableStream } = require('..');
const { PayloadSender } = require('../lib/payloadTransport');
const { PayloadTypes } = require('../lib/payloads');
const { expect } = require('chai');
const importSync= require('import-sync');
const { expect } = importSync('chai/lib/chai');

describe('RequestDisassembler', function () {
it('resolves calls to get stream.', async function () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const { HeaderSerializer, PayloadTypes } = require('../lib/payloads');
const { PayloadConstants } = require('../lib/payloads/payloadConstants');
const { expect } = require('chai');
const importSync= require('import-sync');
const { expect } = importSync('chai/lib/chai');

describe('HeaderSerializer', function () {
it('serializes and deserializes correctly', function () {
Expand Down
3 changes: 2 additions & 1 deletion libraries/botframework-streaming/tests/NamedPipe.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const assert = require('assert');
const { expect } = require('chai');
const importSync= require('import-sync');
const { expect } = importSync('chai/lib/chai');
const { expectEventually } = require('./helpers/expectEventually');
const { NamedPipeClient, NamedPipeServer, StreamingRequest } = require('../lib');
const { NamedPipeTransport } = require('../lib/namedPipe');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { expect } = require('chai');
const importSync= require('import-sync');
const { expect } = importSync('chai/lib/chai');
const { FauxSock, FauxSocket, TestRequest, waitFor } = require('./helpers');
const { NodeWebSocket } = require('../');
const { randomBytes } = require('crypto');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { expect } = require('chai');
const importSync= require('import-sync');
const { expect } = importSync('chai/lib/chai');
const { FauxSocket, TestRequest } = require('./helpers');
const { NodeWebSocket, NodeWebSocketFactory } = require('..');
const { randomBytes } = require('crypto');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
const { SubscribableStream } = require('..');
const { PayloadReceiver, PayloadSender } = require('../lib/payloadTransport');
const { PayloadAssemblerManager, PayloadTypes, StreamManager } = require('../lib/payloads');
const { expect } = require('chai');
const importSync= require('import-sync');
const { expect } = importSync('chai/lib/chai');
const sinon = require('sinon');

class FauxSock {
Expand Down Expand Up @@ -88,7 +89,7 @@ describe('PayloadTransport', function () {

expect(
ps.sendPayload(header, stream, () => {
// This try-catch is required as chai failures need to be caught and bubbled up via done().
// This try-catch is required as chai/lib/chai failures need to be caught and bubbled up via done().
try {
expect(psSenderSpy.callCount).to.equal(4);
done();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ const RequestHandler = require('../lib/requestHandler');
const Response = require('../lib/streamingResponse');
const Request = require('../lib/streamingRequest');
const StreamManager = require('../lib/payloads/streamManager');
const { expect } = require('chai');
const importSync= require('import-sync');
const { expect } = importSync('chai/lib/chai');
const sinon = require('sinon');

class TestRequestHandler extends RequestHandler.RequestHandler {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const { RequestManager } = require('../lib/payloads');
const { expect } = require('chai');
const importSync= require('import-sync');
const { expect } = importSync('chai/lib/chai');
const { expectEventually } = require('./helpers');

const REQUEST_ID = '123';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
const { HttpContent, StreamingRequest, StreamingResponse, SubscribableStream } = require('..');
const { PayloadSender } = require('../lib/payloadTransport');
const { SendOperations } = require('../lib/payloads');
const { expect } = require('chai');
const importSync= require('import-sync');
const { expect } = importSync('chai/lib/chai');

describe('SendOperations', function () {
it('constructs a new instance', function () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
const { PayloadAssembler } = require('../lib/assemblers');
const { PayloadTypes, StreamManager } = require('../lib/payloads');
const { SubscribableStream } = require('..');
const { expect } = require('chai');
const importSync= require('import-sync');
const { expect } = importSync('chai/lib/chai');

describe('StreamManager', function () {
it('properly constructs a new instance', function () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const StreamingRequest = require('../lib/streamingRequest');
const HttpContent = require('../lib/httpContentStream');
const SubscribableStream = require('../lib/subscribableStream');
const chai = require('chai');
const expect = chai.expect;
const importSync= require('import-sync');
const { expect } = importSync('chai/lib/chai');

describe('Streaming Extensions Request tests', function () {
it('creates a new request with undefined properties', function () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const { HttpContent, StreamingResponse, SubscribableStream } = require('..');
const { expect } = require('chai');
const importSync= require('import-sync');
const { expect } = importSync('chai/lib/chai');

describe('Streaming Extensions Response Tests', function () {
it('can set the response body', function () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const { SubscribableStream } = require('../lib/subscribableStream');
const { expect } = require('chai');
const importSync= require('import-sync');
const { expect } = importSync('chai/lib/chai');

describe('Streaming Extensions Stream Tests', function () {
it('throws on invalid encoding types', function () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const { PayloadConstants } = require('../lib/payloads/payloadConstants');
const { expect } = require('chai');
const importSync= require('import-sync');
const { expect } = importSync('chai/lib/chai');

describe('PayloadConstants', function () {
it('has the proper value for MaxPayloadLength', function () {
Expand Down
3 changes: 2 additions & 1 deletion libraries/botframework-streaming/tests/WebSocket.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { expect } = require('chai');
const importSync= require('import-sync');
const { expect } = importSync('chai/lib/chai');
const { spy } = require('sinon');

const { BrowserWebSocket } = require('../lib/index-browser');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { expect } = require('chai');
const importSync= require('import-sync');
const { expect } = importSync('chai/lib/chai');
const { Server } = require('ws');
const { spy, stub } = require('sinon');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
* Licensed under the MIT License.
*/

const { expect } = require('chai');
const importSync= require('import-sync');
const { expect } = importSync('chai/lib/chai');

// chai-as-promised is not actively maintained, we need to build something simple.
// chai/lib/chai-as-promised is not actively maintained, we need to build something simple.

module.exports.expectEventually = async function (promise) {
let error, result;
Expand Down
Loading
Loading