* chore: update dependencies

* More deps updates

* WIP

* Pin PostCSS

* Run audit on lock file

* Tune lockfile more

* Kick CI

* Fix lint

* Fix tests and allign deps

* Fix babel targets

* Fix coverage reporting

* kick CI

Co-authored-by: Eugene Olonov <v-eolonov@microsoft.com>
This commit is contained in:
Eugene 2023-01-21 13:47:32 -08:00 коммит произвёл GitHub
Родитель 196b347244
Коммит 3a6bc48719
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
70 изменённых файлов: 21951 добавлений и 7852 удалений

Просмотреть файл

@ -4,7 +4,7 @@
"@babel/preset-env",
{
"targets": {
"node": "10"
"node": "14"
}
}
],

Просмотреть файл

@ -1,14 +1,44 @@
const fs = require('fs-extra');
/* eslint-disable @typescript-eslint/no-var-requires */
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Bot Framework: http://botframework.com
//
// Bot Framework Emulator Github:
// https://github.com/Microsoft/BotFramwork-Emulator
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
const path = require('path');
const fs = require('fs-extra');
const babelOptions = fs.readJsonSync(path.join(__dirname, '.babelrc'));
const transformer = require('babel-jest');
const { createTransformer } = transformer;
const thisTransformer = createTransformer(babelOptions);
Object.assign(transformer, thisTransformer);
transformer.createTransformer = () => {
return thisTransformer
const createTransformer = () => {
return transformer.createTransformer(babelOptions);
};
module.exports = transformer;
exports.createTransformer = createTransformer;

28716
package-lock.json сгенерированный

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -16,20 +16,25 @@
"uploadcoverage": "cat ./coverage/lcov.info | coveralls"
},
"devDependencies": {
"@babel/cli": "^7.1.0",
"@babel/core": "^7.1.0",
"@babel/plugin-proposal-class-properties": "^7.1.0",
"@babel/plugin-proposal-decorators": "^7.4.0",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
"@babel/plugin-transform-react-jsx": "^7.0.0",
"@babel/preset-env": "^7.1.0",
"@babel/preset-typescript": "^7.1.0",
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "24.8.0",
"@babel/core": "^7.20.2",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-decorators": "^7.20.7",
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
"@babel/plugin-transform-react-jsx": "^7.20.7",
"@babel/preset-env": "^7.20.2",
"@babel/preset-typescript": "^7.18.6",
"babel-jest": "^29.3.1",
"husky": "^1.3.1",
"jest": "^29.3.1",
"jest-environment-jsdom": "^29.3.1",
"lint-staged": "^12.3.7",
"prettier": "^1.15.3"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"jest": {
"setupFilesAfterEnv": [
"./testSetup.js"
@ -49,7 +54,11 @@
"globals": {
"__JEST_ENV__": true
},
"testURL": "http://localhost",
"testEnvironment": "jsdom",
"testEnvironmentOptions": {
"customExportConditions": ["node"],
"url": "http://localhost"
},
"moduleFileExtensions": [
"ts",
"tsx",
@ -65,18 +74,30 @@
".\\.svg$": "<rootDir>/jestMocks/svgMock.js"
}
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.{ts,tsx,js,jsx}": [
"prettier --write"
]
},
"dependencies": {
"lerna": "^3.14.1",
"keytar": "7.3.0"
},
"overrides": {
"minimist@<1.2.6": ">=1.2.6",
"follow-redirects@<1.14.8": ">=1.14.8",
"serialize-javascript@<3.1.0": ">=3.1.0",
"postcss@<7.0.36": ">=7.0.36",
"trim-newlines@<3.0.1": ">=3.0.1",
"parse-path@<5.0.0": ">=5.0.0",
"glob-parent@<5.1.2": ">=5.1.2",
"browserslist@>=4.0.0 <4.16.5": ">=4.16.5",
"ejs@<3.1.7": ">=3.1.7",
"jsdom@<=16.4.0": ">=16.5.0",
"axios@<0.21.2": ">=0.21.2",
"parse-url@<8.1.0": ">=8.1.0",
"minimatch@<3.0.5": ">=3.0.5",
"shell-quote@<=1.7.2": ">=1.7.3",
"got@<11.8.5": ">=11.8.5",
"ajv@<6.12.3": ">=6.12.3"
}
}

Просмотреть файл

@ -4,7 +4,7 @@
"@babel/preset-env",
{
"targets": {
"chrome": "68"
"chrome": "79"
}
}
],

Просмотреть файл

@ -31,7 +31,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
export const replayScenarios = [
module.exports.replayScenarios = [
{
incomingActivities: [
{

Просмотреть файл

@ -19,11 +19,16 @@
"test:watch": "jest --watch"
},
"jest": {
"setupTestFrameworkScriptFile": "../../../../testSetup.js",
"setupFilesAfterEnv": ["../../../../testSetup.js"],
"transform": {
"^.+\\.(tsx?|jsx?)$": "babel-jest"
"^.+\\.(tsx?|jsx?)$": "babel-jest",
"^.+\\.(ts?|js?)$": "babel-jest"
},
"testEnvironment": "jsdom",
"testEnvironmentOptions": {
"customExportConditions": ["node"],
"url": "http://localhost"
},
"testURL": "http://localhost",
"rootDir": "./src",
"testMatch": [
"**/?(*.)(spec|test).(ts)?(x)"
@ -42,16 +47,13 @@
]
},
"devDependencies": {
"@babel/cli": "^7.1.0",
"@babel/core": "^7.1.0",
"@babel/plugin-proposal-class-properties": "^7.1.0",
"@babel/plugin-proposal-decorators": "^7.4.0",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
"@babel/plugin-transform-react-jsx": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.4.4",
"@babel/preset-env": "^7.11.0",
"@babel/preset-typescript": "^7.1.0",
"@babel/runtime": "^7.1.5",
"@babel/core": "^7.20.2",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-decorators": "^7.20.7",
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
"@babel/plugin-transform-react-jsx": "^7.20.7",
"@babel/preset-env": "^7.20.2",
"@babel/preset-typescript": "^7.18.6",
"@types/enzyme": "^3.1.10",
"@types/jest": "24.0.13",
"@types/react": "16.9.17",
@ -60,10 +62,10 @@
"@typescript-eslint/eslint-plugin": "^4.14.2",
"@typescript-eslint/parser": "^4.14.2",
"babel-eslint": "^10.0.1",
"babel-jest": "24.8.0",
"babel-jest": "^29.3.1",
"babel-loader": "^8.0.6",
"babel-preset-react-app": "^3.1.1",
"copy-webpack-plugin": "5.0.5",
"copy-webpack-plugin": "^6.4.1",
"coveralls": "^3.0.1",
"cross-env": "^5.1.3",
"css-loader": "^1.0.1",
@ -72,23 +74,19 @@
"enzyme-adapter-react-16": "^1.1.1",
"eslint": "7.19.0",
"eslint-config-prettier": "^3.5.0",
"eslint-plugin-import": "2.20.0",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-notice": "^0.7.7",
"eslint-plugin-prettier": "^3.0.1",
"file-loader": "^1.1.11",
"hard-source-webpack-plugin": "^0.12.0",
"jest": "24.8.0",
"jest-enzyme": "^7.0.0",
"jsdom-global": "^3.0.2",
"mini-css-extract-plugin": "^0.4.0",
"node-sass": "^4.12.0",
"jest": "^29.3.1",
"jest-environment-jsdom": "^29.3.1",
"sass": "^1.56.2",
"npm-run-all": "^4.1.5",
"react-app-rewired": "^1.4.1",
"react-dev-utils": "^5.0.0",
"react-hot-loader": "^4.1.3",
"resolve-url-loader": "^2.3.0",
"resolve-url-loader": "^5.0.0",
"rimraf": "^2.6.2",
"sass-loader": "^7.1.0",
"sass-loader": "^10.4.1",
"style-loader": "^0.21.0",
"terser-webpack-plugin": "2.3.3",
"typescript": "4.1.3",
@ -96,7 +94,7 @@
"url-loader": "^1.0.1",
"webpack": "^4.32.2",
"webpack-cli": "^3.3.2",
"webpack-dev-server": "^3.4.1"
"webpack-dev-server": "^4.11.1"
},
"dependencies": {
"@bfemulator/app-shared": "^1.0.0",
@ -115,7 +113,7 @@
"core-js": "^3.6.5",
"eslint-plugin-react": "^7.12.3",
"eslint-plugin-security": "^1.4.0",
"markdown-it": "^8.4.2",
"markdown-it": "^12.3.0",
"monaco-editor": "^0.21.2",
"monaco-editor-webpack-plugin": "^2.0.0",
"react": "16.8.6",

Просмотреть файл

@ -138,7 +138,7 @@ describe('The emulator commands', () => {
expect(mockStore.dispatch).toHaveBeenCalledWith({
...beginAdd(undefined),
payload: jasmine.any(Object),
payload: expect.any(Object),
});
remoteCallSpy.mockClear();
});

Просмотреть файл

@ -36,6 +36,7 @@ import * as URL from 'url';
import { SharedConstants } from '@bfemulator/app-shared';
import { CommandServiceImpl, CommandServiceInstance, uniqueId } from '@bfemulator/sdk-shared';
// eslint-disable-next-line @typescript-eslint/no-var-requires
const Electron = (window as any).require('electron');
const { shell } = Electron;

Просмотреть файл

@ -38,7 +38,7 @@ describe('interceptError', () => {
const onSpy = jest.spyOn(process, 'on');
interceptError();
expect(onSpy).toHaveBeenCalledWith('uncaughtException', jasmine.any(Function));
expect(onSpy).toHaveBeenCalledWith('uncaughtException', expect.any(Function));
expect((window as any).onerror()).toBe(true);
onSpy.mockClear();

Просмотреть файл

@ -195,8 +195,8 @@ describe('The botSagas', () => {
const errorNotification = beginAdd(
newNotification('An Error occurred opening the bot at /some/path.bot: Error: oh noes!')
);
(errorNotification as any).payload.notification.timestamp = jasmine.any(Number);
(errorNotification as any).payload.notification.id = jasmine.any(String);
(errorNotification as any).payload.notification.timestamp = expect.any(Number);
(errorNotification as any).payload.notification.id = expect.any(String);
expect(putNotification.value).toEqual(put(errorNotification));
});

Просмотреть файл

@ -80,7 +80,7 @@ import {
getCustomUserGUID,
getWebSpeechFactoryForDocumentId,
} from './chatSagas';
import { createWebChatActivityChannel, ChannelPayload } from './webchatActivityChannel';
import { createWebChatActivityChannel, ChannelPayload } from './webChatActivityChannel';
const mockChatStore = jest.fn((args = undefined) => {
return {};
@ -567,7 +567,7 @@ describe('The ChatSagas,', () => {
// call createCognitiveServicesSpeechServicesPonyfillFactory
expect(gen.next({}).value).toEqual(
call(createCognitiveServicesSpeechServicesPonyfillFactory, {
credentials: jasmine.any(Function),
credentials: expect.any(Function),
})
);
@ -768,7 +768,7 @@ describe('The ChatSagas,', () => {
const existingFactory = {};
expect(gen.next(existingFactory).value).toEqual(
call(createCognitiveServicesSpeechServicesPonyfillFactory, {
credentials: jasmine.any(Function),
credentials: expect.any(Function),
})
);
@ -902,7 +902,7 @@ describe('The ChatSagas,', () => {
const existingFactory = {};
expect(gen.next(existingFactory).value).toEqual(
call(createCognitiveServicesSpeechServicesPonyfillFactory, {
credentials: jasmine.any(Function),
credentials: expect.any(Function),
})
);

Просмотреть файл

@ -196,7 +196,7 @@ describe('The endpointSagas', () => {
describe(' openEndpointContextMenu', () => {
const menuItems = [
{ label: 'Open in Emulator', id: 'open' },
{ label: 'Open in portal', id: 'absLink', enabled: jasmine.any(Boolean) },
{ label: 'Open in portal', id: 'absLink', enabled: expect.any(Boolean) },
{ label: 'Edit configuration', id: 'edit' },
{ label: 'Remove', id: 'forget' },
];

Просмотреть файл

@ -159,8 +159,8 @@ describe('The frameworkSettingsSagas', () => {
gen.next();
const errMsg = `Error while saving emulator settings: oh noes!`;
const notification = newNotification(errMsg);
notification.timestamp = jasmine.any(Number) as any;
notification.id = jasmine.any(String) as any;
notification.timestamp = expect.any(Number) as any;
notification.id = expect.any(String) as any;
expect(gen.throw('oh noes!').value).toEqual(put(beginAdd(notification)));
});
});

Просмотреть файл

@ -32,7 +32,7 @@
//
import { Activity } from 'botframework-schema';
import { createWebChatActivityChannel, WebChatActivityChannel, ChannelPayload } from './webchatActivityChannel';
import { createWebChatActivityChannel, WebChatActivityChannel, ChannelPayload } from './webChatActivityChannel';
describe('Webchat activity channel', () => {
let activityChannel: WebChatActivityChannel;

Просмотреть файл

@ -80,7 +80,7 @@ describe('The AzureLoginFailedDialogContainer component should', () => {
writable: true,
configurable: true,
});
const spy = spyOn(instance.props, 'cancel');
const spy = jest.spyOn(instance.props, 'cancel');
instance.onDialogCancel();
expect(spy).toHaveBeenCalledWith(currentCheckedValue);
});

Просмотреть файл

@ -88,7 +88,7 @@ describe('The AzureLoginSuccessDialogContainer component should', () => {
writable: true,
configurable: true,
});
const spy = spyOn(instance.props, 'cancel');
const spy = jest.spyOn(instance.props, 'cancel');
instance.onDialogCancel();
expect(spy).toHaveBeenCalledWith(currentCheckedValue);
});

Просмотреть файл

@ -254,7 +254,7 @@ describe('BotCreationDialog tests', () => {
appPassword: '',
channelService: undefined,
endpoint: '',
id: jasmine.any(String),
id: expect.any(String),
name: '',
type: 'endpoint',
},

Просмотреть файл

@ -155,7 +155,7 @@ describe('The ResourcesSettings component should', () => {
currentTarget: { getAttribute: () => 'attr' },
} as any);
expect(dispatchSpy).toHaveBeenCalledWith(
executeCommand(true, SharedConstants.Commands.Electron.ShowOpenDialog, jasmine.any(Function), {
executeCommand(true, SharedConstants.Commands.Electron.ShowOpenDialog, expect.any(Function), {
properties: ['openDirectory'],
})
);

Просмотреть файл

@ -186,7 +186,7 @@ describe('The AppSettingsEditorContainer', () => {
const saveSettingsAction = saveFrameworkSettings(normalizedState);
const savedSettings: any = {
...saveSettingsAction.payload,
hash: jasmine.any(String),
hash: expect.any(String),
};
expect(mockDispatch).toHaveBeenLastCalledWith(saveFrameworkSettings(savedSettings));

Просмотреть файл

@ -317,7 +317,7 @@ describe('<EmulatorContainer/>', () => {
executeCommand(
true,
SharedConstants.Commands.Emulator.SaveTranscriptToFile,
jasmine.any(Function) as any,
expect.any(Function) as any,
32,
'convo1'
)

Просмотреть файл

@ -3,7 +3,7 @@ export const ngrokStatusIndicator: string;
export const announcement: string;
export const header: string;
export const tunnelHealthIndicator: string;
export const tunnelError: string;
export const tunnelInactive: string;
export const tunnelActive: string;
export const tunnelInactive: string;
export const tunnelError: string;
export const tunnelDetailsList: string;

Просмотреть файл

@ -160,7 +160,7 @@ describe('The WelcomePageContainer component should', () => {
await instance.onOpenBotClick();
expect(mockDispatch).toHaveBeenCalledWith(
executeCommand(false, SharedConstants.Commands.UI.ShowOpenBotDialog, jasmine.any(Function))
executeCommand(false, SharedConstants.Commands.UI.ShowOpenBotDialog, expect.any(Function))
);
expect(mockOnOpenBot.focus).toHaveBeenCalledTimes(1);
});

Просмотреть файл

@ -246,7 +246,7 @@ describe('<AppMenu />', () => {
await signInItem.onClick();
expect(dispatchSpy).toHaveBeenCalledWith(executeCommand(false, SignInToAzure, jasmine.any(Function)));
expect(dispatchSpy).toHaveBeenCalledWith(executeCommand(false, SignInToAzure, expect.any(Function)));
});
it('should get a sign out menu item for a signed in user', async () => {
@ -257,7 +257,7 @@ describe('<AppMenu />', () => {
await signInItem.onClick();
expect(dispatchSpy).toHaveBeenCalledWith(executeCommand(true, SignUserOutOfAzure, jasmine.any(Function)));
expect(dispatchSpy).toHaveBeenCalledWith(executeCommand(false, InvalidateAzureArmToken, jasmine.any(Function)));
expect(dispatchSpy).toHaveBeenCalledWith(executeCommand(true, SignUserOutOfAzure, expect.any(Function)));
expect(dispatchSpy).toHaveBeenCalledWith(executeCommand(false, InvalidateAzureArmToken, expect.any(Function)));
});
});

Просмотреть файл

@ -128,7 +128,7 @@ describe('The EndpointExplorer component should', () => {
await instance.onCreateNewBotClick();
expect(mockDispatch).toHaveBeenCalledWith(
executeCommand(false, SharedConstants.Commands.UI.ShowBotCreationDialog, jasmine.any(Function))
executeCommand(false, SharedConstants.Commands.UI.ShowBotCreationDialog, expect.any(Function))
);
expect(mockCreateNewBotButton.focus).toHaveBeenCalledTimes(1);
});
@ -145,8 +145,8 @@ describe('The EndpointExplorer component should', () => {
const message = `An Error occurred on the Bot Not Open Explorer: oh noes!`;
const notification = newNotification(message);
const action = beginAdd(notification);
notification.timestamp = jasmine.any(Number) as any;
notification.id = jasmine.any(String) as any;
notification.timestamp = expect.any(Number) as any;
notification.id = expect.any(String) as any;
expect(mockDispatch).toHaveBeenLastCalledWith(action);
expect(spy).toHaveBeenCalled();

Просмотреть файл

@ -159,7 +159,7 @@ describe('The ServicesExplorer component should', () => {
await instance.onChooseLocationClick();
expect(mockDispatch).toHaveBeenCalledWith(
openResourcesSettings(ResourcesSettingsContainer, jasmine.any(Function) as any)
openResourcesSettings(ResourcesSettingsContainer, expect.any(Function) as any)
);
});

Просмотреть файл

@ -199,7 +199,7 @@ describe('The ServicesExplorer component', () => {
pickerComponent: ConnectedServicePickerContainer,
progressIndicatorComponent: ProgressIndicatorContainer,
},
jasmine.any(Function) as any,
expect.any(Function) as any,
{ x: 150, y: 200 }
)
);

Просмотреть файл

@ -27,7 +27,6 @@
//
import { ChatReplayData, RestartConversationStatus } from '@bfemulator/app-shared';
import cloneDeep from 'clone-deep';
import { Activity } from 'botframework-schema';
import { replayScenarios } from '../../mocks/conversationQueueMocks';
@ -37,7 +36,7 @@ import { ConversationQueue, WebChatEvents } from './restartConversationQueue';
describe('Restart Conversation Queue', () => {
let scenarios;
beforeEach(() => {
scenarios = cloneDeep(replayScenarios);
scenarios = JSON.parse(JSON.stringify(replayScenarios));
});
it('should validate if it is in Replay conversational flow', () => {

Просмотреть файл

@ -36,7 +36,7 @@ const path = require('path');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const TerserWebpackPlugin = require('terser-webpack-plugin');
const webpack = require('webpack');
const { DllPlugin, DllReferencePlugin, NamedModulesPlugin, DefinePlugin, WatchIgnorePlugin } = webpack;
const { DllPlugin, DllReferencePlugin, DefinePlugin, WatchIgnorePlugin } = webpack;
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
const { npm_lifecycle_event = '' } = process.env;
@ -46,7 +46,7 @@ const use = [
loader: 'babel-loader',
},
];
const defaultConfig = {
const defaultConfig = () => ({
entry: {
index: require.resolve('./src/index.tsx'),
},
@ -71,7 +71,30 @@ const defaultConfig = {
},
{
test: /\.css$/,
use: ['style-loader', 'resolve-url-loader', 'css-loader'],
include: [/node_modules/],
use: [
'style-loader',
{
loader: 'css-loader',
options: {
sourceMap: true,
},
},
],
},
{
test: /\.css$/,
exclude: [/node_modules/],
use: [
'style-loader',
'resolve-url-loader',
{
loader: 'css-loader',
options: {
sourceMap: true,
},
},
],
},
{
test: /\.(png|jpg|gif|svg|woff|woff2)$/,
@ -101,7 +124,12 @@ const defaultConfig = {
},
},
'resolve-url-loader',
'sass-loader',
{
loader: 'sass-loader',
options: {
sourceMap: true,
},
},
],
},
{
@ -130,21 +158,26 @@ const defaultConfig = {
publicPath: '/',
},
optimization: {
moduleIds: 'named',
},
plugins: [
new NamedModulesPlugin(),
new CopyWebpackPlugin([
{ from: './src/splash.html', to: './splash.html' },
{ from: './src/index.html', to: './index.html' },
{ from: './src/ui/styles/themes/light.css', to: 'themes/light.css' },
{ from: './src/ui/styles/themes/dark.css', to: 'themes/dark.css' },
{
from: './src/ui/styles/themes/high-contrast.css',
to: 'themes/high-contrast.css',
},
{ from: './src/ui/styles/themes/neutral.css', to: 'css/neutral.css' },
{ from: './src/ui/styles/themes/fonts.css', to: 'css/fonts.css' },
{ from: './src/ui/styles/themes/redline.css', to: 'css/redline.css' },
]),
new CopyWebpackPlugin({
patterns: [
{ from: './src/splash.html', to: './splash.html' },
{ from: './src/index.html', to: './index.html' },
{ from: './src/ui/styles/themes/light.css', to: 'themes/light.css' },
{ from: './src/ui/styles/themes/dark.css', to: 'themes/dark.css' },
{
from: './src/ui/styles/themes/high-contrast.css',
to: 'themes/high-contrast.css',
},
{ from: './src/ui/styles/themes/neutral.css', to: 'css/neutral.css' },
{ from: './src/ui/styles/themes/fonts.css', to: 'css/fonts.css' },
{ from: './src/ui/styles/themes/redline.css', to: 'css/redline.css' },
],
}),
new DefinePlugin({
DEV: JSON.stringify(npm_lifecycle_event.includes('dev')),
}),
@ -153,13 +186,13 @@ const defaultConfig = {
languages: ['json'],
}),
],
};
});
const buildConfig = mode => {
const config = {
...defaultConfig,
...defaultConfig(),
plugins: [
...defaultConfig.plugins,
...defaultConfig().plugins,
new DllReferencePlugin({
manifest: require(path.join(manifestLocation, 'vendors-manifest.json')),
}),
@ -188,13 +221,13 @@ const buildConfig = mode => {
};
const sharedConfig = () => ({
...defaultConfig,
...defaultConfig(),
entry: {
shared: [path.resolve('./src/shared.ts')],
},
output: {
...defaultConfig.output,
...defaultConfig().output,
library: '[name]_[hash]',
},
@ -203,7 +236,7 @@ const sharedConfig = () => ({
},
plugins: [
...defaultConfig.plugins,
...defaultConfig().plugins,
new DllPlugin({
path: path.join(manifestLocation, 'shared-manifest.json'),
name: '[name]_[hash]',
@ -216,18 +249,18 @@ const sharedConfig = () => ({
});
const vendorsConfig = () => ({
...defaultConfig,
...defaultConfig(),
entry: {
vendors: [path.resolve('./src/vendors.ts')],
},
output: {
...defaultConfig.output,
...defaultConfig().output,
library: '[name]_[hash]',
},
plugins: [
...defaultConfig.plugins,
...defaultConfig().plugins,
new DllPlugin({
path: path.join(manifestLocation, 'vendors-manifest.json'),
name: '[name]_[hash]',

Просмотреть файл

@ -4,7 +4,7 @@
"@babel/preset-env",
{
"targets": {
"node": "10"
"node": "14"
}
}
],

Просмотреть файл

@ -52,15 +52,20 @@
"verbose": false
},
"jest": {
"rootDir": "./src",
"setupTestFrameworkScriptFile": "../../../../testSetup.js",
"setupFilesAfterEnv": ["../../../../testSetup.js"],
"transform": {
"^.+\\.(tsx|ts|js)$": "babel-jest"
"^.+\\.(tsx?|jsx?)$": "babel-jest",
"^.+\\.(ts?|js?)$": "babel-jest"
},
"testEnvironment": "jsdom",
"testEnvironmentOptions": {
"customExportConditions": ["node"],
"url": "http://localhost"
},
"rootDir": "./src",
"testMatch": [
"**/?(*.)(spec|test).(ts)?(x)"
],
"testURL": "http://localhost",
"moduleFileExtensions": [
"ts",
"tsx",
@ -72,16 +77,14 @@
},
"license": "MIT",
"devDependencies": {
"@babel/cli": "^7.1.0",
"@babel/core": "^7.1.0",
"@babel/plugin-proposal-class-properties": "^7.1.0",
"@babel/plugin-proposal-decorators": "^7.4.0",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
"@babel/plugin-transform-react-jsx": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.4.4",
"@babel/preset-env": "^7.11.0",
"@babel/preset-typescript": "^7.1.0",
"@electron/get": "^1.13.1",
"@babel/core": "^7.20.2",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-decorators": "^7.20.7",
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
"@babel/plugin-transform-react-jsx": "^7.20.7",
"@babel/preset-env": "^7.20.2",
"@babel/preset-typescript": "^7.18.6",
"@electron/get": "^2.0.2",
"@types/async": "^2.0.47",
"@types/chokidar": "^1.7.5",
"@types/formidable": "^1.0.30",
@ -97,28 +100,28 @@
"@typescript-eslint/eslint-plugin": "^4.14.2",
"@typescript-eslint/parser": "^4.14.2",
"asar-integrity": "^0.2.4",
"babel-jest": "24.8.0",
"babel-jest": "^29.3.1",
"botbuilder": "^4.5.1",
"chalk": "^2.4.1",
"concurrently": "^3.5.1",
"cross-env": "^5.1.3",
"del": "^3.0.0",
"electron": "13.6.1",
"electron-builder": "22.11.10",
"electron-rebuild": "2.3.4",
"electron": "13.6.6",
"electron-builder": "23.6.0",
"@electron/rebuild": "^3.2.x",
"eslint": "7.19.0",
"eslint-config-prettier": "^3.5.0",
"eslint-plugin-import": "2.20.0",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-notice": "^0.7.7",
"eslint-plugin-prettier": "^3.0.1",
"extract-zip": "^2.0.1",
"fancy-log": "^1.3.2",
"jest": "24.8.0",
"jest": "^29.3.1",
"license-list": "^0.1.3",
"ncp": "^2.0.0",
"nodemon": "1.18.11",
"npm-run-all": "^4.1.5",
"spectron": "^6.0.0",
"spectron": "^15.0.0",
"through2": "^2.0.3",
"typescript": "4.1.3",
"vinyl-buffer": "^1.0.1",
@ -136,15 +139,15 @@
"@microsoft/bf-chatdown": "4.7.0",
"applicationinsights": "^1.0.8",
"base64url": "3.0.0",
"botframework-config": "4.4.0",
"botframework-schema": "4.14.0",
"botframework-config": "^4.4.0",
"botframework-schema": "^4.14.0",
"chokidar": "^2.0.2",
"command-line-args": "^5.0.2",
"electron-updater": "4.3.5",
"eslint-plugin-security": "^1.4.0",
"formidable": "^1.1.1",
"fs-extra": "^6.0.1",
"got": "^7.1.0",
"got": "^11.8.5",
"http-status-codes": "^1.3.0",
"https-proxy-agent": "2.2.3",
"jest-fetch-mock": "^1.6.2",
@ -159,12 +162,12 @@
"redux": "^3.7.2",
"redux-saga": "^0.16.0",
"restify": "^8.4.0",
"restify-cors-middleware": "^1.1.0",
"restify-cors-middleware2": "^2.2.0",
"rsa-pem-from-mod-exp": "^0.8.4",
"sanitize-filename": "^1.6.1",
"semver": "^5.5.0",
"tslib": "^1.9.0",
"ws": "^5.0.0",
"xmldom": "^0.1.27"
"xmldom": "^0.6.0"
}
}

Просмотреть файл

@ -191,15 +191,15 @@ describe('The clientInitCommands', () => {
await command();
expect(commands).toMatchInlineSnapshot(`
Array [
Object {
"args": Array [
[
{
"args": [
"electron:set-title-bar",
],
"type": "local",
},
Object {
"args": Array [
{
"args": [
"shell:toggle-full-screen",
false,
false,

Просмотреть файл

@ -108,7 +108,7 @@ describe('main', () => {
(emulatorApplication as any).initializeSystemPreferencesListeners();
expect(onSpy).toHaveBeenCalledWith('updated', jasmine.any(Function));
expect(onSpy).toHaveBeenCalledWith('updated', expect.any(Function));
onSpy.mockClear();
});

Просмотреть файл

@ -187,16 +187,19 @@ describe('the ngrok ', () => {
expect(mockOk).toBe(1);
});
it('should disconnect', async done => {
it('should disconnect', async () => {
let disconnected = false;
ngrok.ngrokEmitter.on('disconnect', () => {
disconnected = true;
expect(disconnected).toBe(true);
done();
const ret = new Promise<void>(resolve => {
ngrok.ngrokEmitter.on('disconnect', () => {
disconnected = true;
expect(disconnected).toBe(true);
resolve();
});
});
await connectToNgrokInstance(ngrok);
await ngrok.disconnect();
return ret;
});
it('should throw when the number of reties to retrieve the ngrok url are exhausted.', async () => {
@ -228,18 +231,17 @@ describe('the ngrok ', () => {
});
describe('ngrok tunnel heath status check operations', () => {
it('should check tunnel status every minute and report success if tunnel ping was a success.', async done => {
it('should check tunnel status every minute and report success if tunnel ping was a success.', async () => {
jest.useFakeTimers();
await connectToNgrokInstance(ngrok);
ngrok.ngrokEmitter.on('onTunnelStatusPing', (msg: TunnelStatus) => {
expect(msg).toEqual(TunnelStatus.Active);
done();
});
jest.advanceTimersByTime(intervalForEachPing + 1);
});
// First minute generates a Too many connections error. Second minute the tunnel resets back to an active state
it('Should not emit onTunnel error if ngrok tunnel error state has not changed to prevent notification flooding.', async done => {
it('Should not emit onTunnel error if ngrok tunnel error state has not changed to prevent notification flooding.', async () => {
//Situation where ngrok saga does the ping and calls onTunnelPingError with status 400. Before the next ping happens dispatching an action to set the state to reflect the same. Hence, no notificaiton flooding.
jest.useFakeTimers();
const tunnelErrorMock = jest.fn();
@ -260,11 +262,10 @@ describe('the ngrok ', () => {
);
jest.advanceTimersByTime(intervalForEachPing + 1);
expect(tunnelErrorMock).toBeCalledTimes(1);
done();
});
// // First minute generates a Too many connections error for first minute. Second minute the tunnel resets back to an active state
it('Should dynamically check for status change every minute. ', async done => {
it('Should dynamically check for status change every minute. ', async () => {
jest.useFakeTimers();
mockDispatch.mockImplementationOnce((args: NgrokTunnelAction<StatusCheckOnTunnel>) => {
args.payload.onTunnelPingError({
@ -277,11 +278,14 @@ describe('the ngrok ', () => {
expect(err.errorMessage).toBe('Tunnel has too many connections');
});
await connectToNgrokInstance(ngrok);
ngrok.ngrokEmitter.on('onTunnelStatusPing', (status: TunnelStatus) => {
expect(status).toBe(TunnelStatus.Active);
done();
const ret = new Promise<void>(resolve => {
ngrok.ngrokEmitter.on('onTunnelStatusPing', (status: TunnelStatus) => {
expect(status).toBe(TunnelStatus.Active);
resolve();
});
});
jest.advanceTimersByTime(60001);
return ret;
});
});
});

Просмотреть файл

@ -68,29 +68,27 @@ export class OpenIdMetadata {
private refreshCache(cb: (err: Error) => void): void {
const options = {
method: 'GET',
url: this.url,
json: true,
json: {},
strictSSL: false,
useElectronNet: true,
};
} as const;
got(options)
got(this.url, options)
.then(resp => {
if (resp.statusCode >= 400 || !resp.body) {
throw new Error('Failed to load openID config: ' + resp.statusCode);
}
const openIdConfig = resp.body as OpenIdConfig;
const openIdConfig = (resp.body as unknown) as OpenIdConfig;
const options1 = {
method: 'GET',
url: openIdConfig.jwks_uri,
json: true,
json: {},
strictSSL: false,
useElectronNet: true,
};
} as const;
got(options1)
got(openIdConfig.jwks_uri, options1)
.then((resp1: any) => {
if (resp1.statusCode >= 400 || !resp1.body) {
throw new Error('Failed to load Keys: ' + resp1.statusCode);

Просмотреть файл

@ -194,13 +194,12 @@ class ProtocolHandlerImpl implements ProtocolHandler {
/** Downloads a transcript from a URL provided in the protocol string,
* parses out the list of activities, and has the client side open it
*/
public openTranscript(protocol: Protocol): void {
public openTranscript(protocol: Protocol): Promise<void> {
const { url } = protocol.parsedArgs;
const options = { url };
return got(options)
return got(url)
.then(res => {
if (/^2\d\d$/.test(res.statusCode)) {
if (res.statusCode === 200) {
if (res.body) {
try {
// parse the activities from the downloaded transcript
@ -219,7 +218,7 @@ class ProtocolHandlerImpl implements ProtocolHandler {
} else {
if (res.statusCode === 401) {
// auth failed
const stat = res.body || res.statusText || '';
const stat = res.body || res.statusMessage || '';
throw new Error(`Authorization error while trying to download transcript: ${stat}`);
}
if (res.statusCode === 404) {

Просмотреть файл

@ -42,7 +42,7 @@ import {
networkResponseItem,
} from '@bfemulator/sdk-shared';
import { createServer, plugins, Server, Response, Route } from 'restify';
import CORS from 'restify-cors-middleware';
import CORS from 'restify-cors-middleware2';
import { newNotification, SharedConstants } from '@bfemulator/app-shared';
import { mountAllRoutes } from './routes/mountAllRoutes';

Просмотреть файл

@ -37,7 +37,7 @@ import { OK } from 'http-status-codes';
import { getActivitiesForConversation } from './getActivitiesForConversation';
describe('getActivitiesForConversation handler', () => {
it('should get all the activities for a conversation', async done => {
it('should get all the activities for a conversation', async () => {
const transcripts: Activity[] = [
{
id: '1',
@ -65,6 +65,5 @@ describe('getActivitiesForConversation handler', () => {
const activityHandler = getActivitiesForConversation(state);
await activityHandler(req, res, jest.fn());
expect(res.send).toHaveBeenCalledWith(OK, transcripts);
done();
});
});

Просмотреть файл

@ -55,7 +55,7 @@ describe('reconnectToConversation handler', () => {
expect(res.json).toHaveBeenCalledWith(HttpStatus.OK, {
conversationId: req.conversation.conversationId,
token: req.conversation.conversationId,
expires_in: jasmine.any(Number),
expires_in: expect.any(Number),
streamUrl: '',
});
expect(res.end).toHaveBeenCalled();

Просмотреть файл

@ -65,7 +65,7 @@ describe('startConversation handler', () => {
expect(mockCreatedConversation.sendConversationUpdate).toHaveBeenCalledWith(
[
{ id: jasmine.any(String), name: 'User' },
{ id: expect.any(String), name: 'User' },
{ id: req.botEndpoint.botId, name: 'Bot' },
],
undefined
@ -73,7 +73,7 @@ describe('startConversation handler', () => {
expect(res.json).toHaveBeenCalledWith(HttpStatus.CREATED, {
conversationId: mockCreatedConversation.conversationId,
token: req.botEndpoint.id,
expires_in: jasmine.any(Number),
expires_in: expect.any(Number),
streamUrl: '',
});
expect(res.end).toHaveBeenCalled();
@ -115,7 +115,7 @@ describe('startConversation handler', () => {
expect(res.json).toHaveBeenCalledWith(HttpStatus.OK, {
conversationId: mockCreatedConversation.conversationId,
token: req.botEndpoint.id,
expires_in: jasmine.any(Number),
expires_in: expect.any(Number),
streamUrl: '',
});
expect(res.end).toHaveBeenCalled();
@ -161,7 +161,7 @@ describe('startConversation handler', () => {
expect(res.json).toHaveBeenCalledWith(HttpStatus.OK, {
conversationId: mockCreatedConversation.conversationId,
token: req.botEndpoint.id,
expires_in: jasmine.any(Number),
expires_in: expect.any(Number),
streamUrl: '',
});
expect(res.end).toHaveBeenCalled();

Просмотреть файл

@ -263,7 +263,7 @@ describe('BotEndpoint', () => {
expect(response).toBe('I am an access token!');
expect(endpoint.accessToken).toBe('I am an access token!');
expect(endpoint.accessTokenExpires).not.toEqual(accessTokenExpires);
expect(endpoint.accessTokenExpires).toEqual(jasmine.any(Number));
expect(endpoint.accessTokenExpires).toEqual(expect.any(Number));
expect(mockFetch).toHaveBeenCalledWith(authentication.tokenEndpoint, {
method: 'POST',
body: new URLSearchParams({
@ -285,7 +285,7 @@ describe('BotEndpoint', () => {
expect(response).toBe('I am an access token!');
expect(endpoint.accessToken).toBe('I am an access token!');
expect(endpoint.accessTokenExpires).not.toEqual(accessTokenExpires);
expect(endpoint.accessTokenExpires).toEqual(jasmine.any(Number));
expect(endpoint.accessTokenExpires).toEqual(expect.any(Number));
expect(mockFetch).toHaveBeenCalledWith(usGovernmentAuthentication.tokenEndpoint, {
method: 'POST',
body: new URLSearchParams({

Просмотреть файл

@ -82,7 +82,7 @@ describe('WebSocketServer', () => {
const port = await WebSocketServer.init();
expect(port).toBe(56273);
expect(mockRestServer.get).toHaveBeenCalledWith('/ws/:conversationId', jasmine.any(Function));
expect(mockRestServer.get).toHaveBeenCalledWith('/ws/:conversationId', expect.any(Function));
expect((WebSocketServer as any)._restServer).toEqual(mockRestServer);
});

Просмотреть файл

@ -127,17 +127,17 @@ describe('The LuisApiService class', () => {
expect(mockArgsPassedToFetch[1]).toEqual({
url: 'https://api.eu.luis.ai/api/v2.0/bots/programmatickey',
headers: jasmine.any(Object),
headers: expect.any(Object),
});
expect(mockArgsPassedToFetch[2]).toEqual({
url: 'https://api.au.luis.ai/api/v2.0/bots/programmatickey',
headers: jasmine.any(Object),
headers: expect.any(Object),
});
expect(mockArgsPassedToFetch[3]).toEqual({
url: 'https://westus.api.cognitive.microsoft.com/luis/api/v2.0/apps/',
headers: jasmine.any(Object),
headers: expect.any(Object),
});
});
});

Просмотреть файл

@ -183,7 +183,7 @@ describe('The QnaApiService happy path', () => {
expect(mockArgsPassedToFetch[0]).toEqual({
headers: {
headers: {
'x-ms-date': jasmine.any(String),
'x-ms-date': expect.any(String),
Accept: 'application/json, text/plain, */*',
Authorization: 'Bearer bm90aGluZw.eyJ1cG4iOiJnbGFzZ293QHNjb3RsYW5kLmNvbSJ9.7gjdshgfdsk98458205jfds9843fjds',
},
@ -194,7 +194,7 @@ describe('The QnaApiService happy path', () => {
expect(mockArgsPassedToFetch[1]).toEqual({
headers: {
headers: {
'x-ms-date': jasmine.any(String),
'x-ms-date': expect.any(String),
Accept: 'application/json, text/plain, */*',
Authorization: 'Bearer bm90aGluZw.eyJ1cG4iOiJnbGFzZ293QHNjb3RsYW5kLmNvbSJ9.7gjdshgfdsk98458205jfds9843fjds',
},
@ -207,7 +207,7 @@ describe('The QnaApiService happy path', () => {
expect(mockArgsPassedToFetch[2]).toEqual({
headers: {
headers: {
'x-ms-date': jasmine.any(String),
'x-ms-date': expect.any(String),
Accept: 'application/json, text/plain, */*',
Authorization: 'Bearer bm90aGluZw.eyJ1cG4iOiJnbGFzZ293QHNjb3RsYW5kLmNvbSJ9.7gjdshgfdsk98458205jfds9843fjds',
},
@ -221,7 +221,7 @@ describe('The QnaApiService happy path', () => {
url: 'https://management.azure.com//subscriptions/1234/listKeys?api-version=2017-04-18',
headers: {
headers: {
'x-ms-date': jasmine.any(String),
'x-ms-date': expect.any(String),
Authorization: 'Bearer bm90aGluZw.eyJ1cG4iOiJnbGFzZ293QHNjb3RsYW5kLmNvbSJ9.7gjdshgfdsk98458205jfds9843fjds',
Accept: 'application/json, text/plain, */*',
},
@ -233,7 +233,7 @@ describe('The QnaApiService happy path', () => {
url: 'https://management.azure.com//subscriptions/12324/listKeys?api-version=2017-04-18',
headers: {
headers: {
'x-ms-date': jasmine.any(String),
'x-ms-date': expect.any(String),
Authorization: 'Bearer bm90aGluZw.eyJ1cG4iOiJnbGFzZ293QHNjb3RsYW5kLmNvbSJ9.7gjdshgfdsk98458205jfds9843fjds',
Accept: 'application/json, text/plain, */*',
},

Просмотреть файл

@ -100,7 +100,7 @@ describe('The Ngrok Sagas', () => {
);
});
it('should call onTunnelPingSuccess', async done => {
it('should call onTunnelPingSuccess', () => {
const onSuccessMock = jest.fn();
const onFailureMock = jest.fn();
const action: NgrokTunnelAction<StatusCheckOnTunnel> = {
@ -130,10 +130,9 @@ describe('The Ngrok Sagas', () => {
expect(result.value).toEqual(put(setTimeIntervalSinceLastPing(TunnelCheckTimeInterval.SecondInterval)));
expect(onSuccessMock).toHaveBeenCalled();
expect(onFailureMock).not.toHaveBeenCalled();
done();
});
it('should emit ngrok error - Too many connections.', async done => {
it('should emit ngrok error - Too many connections.', async () => {
const tunnelError: TunnelError = {
statusCode: 429,
errorMessage: 'The tunnel session has violated the rate-limit policy of 20 connections per minute.',
@ -141,18 +140,20 @@ describe('The Ngrok Sagas', () => {
mockTunnelStatusResponse.mockReturnValueOnce(
Promise.resolve(tunnelResponseGeneric(tunnelError.statusCode, tunnelError.errorMessage))
);
mockStore.dispatch(
checkOnTunnel({
onTunnelPingSuccess: jest.fn(),
onTunnelPingError: err => {
expect(err.status).toBe(tunnelError.statusCode);
done();
},
})
);
return new Promise<void>(resolve => {
mockStore.dispatch(
checkOnTunnel({
onTunnelPingSuccess: jest.fn(),
onTunnelPingError: err => {
expect(err.status).toBe(tunnelError.statusCode);
resolve();
},
})
);
});
});
it('should emit ngrok error - No server header present in the response headers.', async done => {
it('should emit ngrok error - No server header present in the response headers.', async () => {
const tunnelError: TunnelError = {
statusCode: 404,
errorMessage: 'Tunnel not found.',
@ -160,18 +161,20 @@ describe('The Ngrok Sagas', () => {
mockTunnelStatusResponse.mockReturnValueOnce(
Promise.resolve(tunnelResponseGeneric(tunnelError.statusCode, tunnelError.errorMessage, new Map()))
);
mockStore.dispatch(
checkOnTunnel({
onTunnelPingSuccess: jest.fn(),
onTunnelPingError: err => {
expect(err.status).toBe(tunnelError.statusCode);
done();
},
})
);
return new Promise<void>(resolve => {
mockStore.dispatch(
checkOnTunnel({
onTunnelPingSuccess: jest.fn(),
onTunnelPingError: err => {
expect(err.status).toBe(tunnelError.statusCode);
resolve();
},
})
);
});
});
it('should emit ngrok error - Tunnel Expired.', async done => {
it('should emit ngrok error - Tunnel Expired.', async () => {
const tunnelError: TunnelError = {
statusCode: 402,
errorMessage: 'Other generic tunnel errors.',
@ -179,18 +182,20 @@ describe('The Ngrok Sagas', () => {
mockTunnelStatusResponse.mockReturnValueOnce(
Promise.resolve(tunnelResponseGeneric(tunnelError.statusCode, tunnelError.errorMessage, new Map()))
);
mockStore.dispatch(
checkOnTunnel({
onTunnelPingSuccess: jest.fn(),
onTunnelPingError: err => {
expect(err.status).toBe(tunnelError.statusCode);
done();
},
})
);
return new Promise<void>(resolve => {
mockStore.dispatch(
checkOnTunnel({
onTunnelPingSuccess: jest.fn(),
onTunnelPingError: err => {
expect(err.status).toBe(tunnelError.statusCode);
resolve();
},
})
);
});
});
it('should emit ngrok generic error 500.', async done => {
it('should emit ngrok generic error 500.', async () => {
const tunnelError: TunnelError = {
statusCode: 500,
errorMessage: 'Other generic tunnel errors.',
@ -198,18 +203,20 @@ describe('The Ngrok Sagas', () => {
mockTunnelStatusResponse.mockReturnValueOnce(
Promise.resolve(tunnelResponseGeneric(tunnelError.statusCode, tunnelError.errorMessage))
);
mockStore.dispatch(
checkOnTunnel({
onTunnelPingSuccess: jest.fn(),
onTunnelPingError: err => {
expect(err.status).toBe(tunnelError.statusCode);
done();
},
})
);
return new Promise<void>(resolve => {
mockStore.dispatch(
checkOnTunnel({
onTunnelPingSuccess: jest.fn(),
onTunnelPingError: err => {
expect(err.status).toBe(tunnelError.statusCode);
resolve();
},
})
);
});
});
it('take the latest dispatched tunnel ping action always', async done => {
it('take the latest dispatched tunnel ping action always', async () => {
const tunnelError: TunnelError = {
statusCode: 500,
errorMessage: 'Other generic tunnel errors.',
@ -235,18 +242,20 @@ describe('The Ngrok Sagas', () => {
})
);
mockStore.dispatch(
checkOnTunnel({
onTunnelPingSuccess: () => {
expect(onErrorFake).not.toHaveBeenCalled();
done();
},
onTunnelPingError: jest.fn(),
})
);
return new Promise<void>(resolve => {
mockStore.dispatch(
checkOnTunnel({
onTunnelPingSuccess: () => {
expect(onErrorFake).not.toHaveBeenCalled();
resolve();
},
onTunnelPingError: jest.fn(),
})
);
});
});
it('should throw onTunnelPing error if the request times out with a status 404', async done => {
it('should throw onTunnelPing error if the request times out with a status 404', async () => {
jest.useFakeTimers();
mockTunnelStatusResponse.mockImplementationOnce(
() =>
@ -258,15 +267,18 @@ describe('The Ngrok Sagas', () => {
})
);
mockStore.dispatch(
checkOnTunnel({
onTunnelPingSuccess: jest.fn(),
onTunnelPingError: (err: Response) => {
expect(err.status).toBe(404);
done();
},
})
);
const ret = new Promise<void>(resolve => {
mockStore.dispatch(
checkOnTunnel({
onTunnelPingSuccess: jest.fn(),
onTunnelPingError: (err: Response) => {
expect(err.status).toBe(404);
resolve();
},
})
);
});
jest.advanceTimersByTime(tunnelPingTimeout);
return ret;
});
});

Просмотреть файл

@ -42,13 +42,11 @@ jest.mock('fs', () => ({
}));
describe('copy files from source to destination asynchronously', () => {
it('should resolve promise if operation was successful', async done => {
it('should resolve promise if operation was successful', async () => {
await expect(copyFileAsync('1.txt', '2.txt')).resolves.toBeUndefined();
done();
});
it('should reject promise if unsuccessful', async (done: any) => {
it('should reject promise if unsuccessful', async () => {
await expect(copyFileAsync('1.txt', '')).rejects.toBe('Error copying file: Incorrect folder permissions.');
done();
});
});

Просмотреть файл

@ -54,14 +54,13 @@ describe('fetch with timeout', () => {
beforeEach(() => {
jest.useRealTimers();
});
it('should return a response with status 200', async done => {
it('should return a response with status 200', async () => {
jest.useFakeTimers();
const result = await fetchWithTimeout('http://test.com', {});
expect(result.status).toBe(200);
done();
});
it('should throw an error if promise not resolved within the timeout specified', async done => {
it('should throw an error if promise not resolved within the timeout specified', async () => {
mockTunnelStatusResponse.mockImplementationOnce(() => {
return new Promise(resolve => {
setTimeout(() => {
@ -70,15 +69,18 @@ describe('fetch with timeout', () => {
});
});
jest.useFakeTimers();
fetchWithTimeout('http://test.com', {}, 40000)
.then(() => {
// Should not hit
expect(true).toBeFalsy();
})
.catch(er => {
expect(er).toBeDefined();
done();
});
const ret = new Promise<void>(resolve => {
fetchWithTimeout('http://test.com', {}, 40000)
.then(() => {
// Should not hit
expect(true).toBeFalsy();
})
.catch(er => {
expect(er).toBeDefined();
resolve();
});
});
jest.advanceTimersByTime(40001);
return ret;
});
});

Просмотреть файл

@ -18,24 +18,24 @@
"author": "",
"license": "ISC",
"devDependencies": {
"@babel/cli": "^7.1.0",
"@babel/core": "^7.1.0",
"@babel/plugin-proposal-class-properties": "^7.1.0",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
"@babel/plugin-transform-react-jsx": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.4.4",
"@babel/preset-env": "^7.11.0",
"@babel/preset-typescript": "^7.1.0",
"@babel/core": "^7.20.2",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-decorators": "^7.20.7",
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
"@babel/plugin-transform-react-jsx": "^7.20.7",
"@babel/plugin-transform-runtime": "^7.19.6",
"@babel/preset-env": "^7.20.2",
"@babel/preset-typescript": "^7.18.6",
"@types/jest": "24.0.13",
"@typescript-eslint/eslint-plugin": "^4.14.2",
"@typescript-eslint/parser": "^4.14.2",
"babel-jest": "24.8.0",
"babel-jest": "^29.3.1",
"eslint": "7.19.0",
"eslint-config-prettier": "^3.5.0",
"eslint-plugin-import": "2.20.0",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-notice": "^0.7.7",
"eslint-plugin-prettier": "^3.0.1",
"jest": "24.8.0",
"jest": "^29.3.1",
"rimraf": "^2.6.2",
"typescript": "4.1.3"
},
@ -43,7 +43,7 @@
"@babel/runtime": "^7.1.5",
"@bfemulator/sdk-shared": "^1.0.0",
"botframework-config": "4.4.0",
"botframework-schema": "4.14.0",
"botframework-schema": "4.17.0",
"eslint-plugin-security": "^1.4.0",
"tslib": "^1.9.0"
},

Просмотреть файл

@ -85,8 +85,8 @@ describe('connected service actions', () => {
});
it('should create an openAddServiceContextMenu action', () => {
const payload: any = { resolver: jasmine.any(Function) };
const action = openAddServiceContextMenu(payload, jasmine.any(Function) as any, { x: 150, y: 300 });
const payload: any = { resolver: expect.any(Function) };
const action = openAddServiceContextMenu(payload, expect.any(Function) as any, { x: 150, y: 300 });
expect(action.type).toBe(OPEN_ADD_CONNECTED_SERVICE_CONTEXT_MENU);
expect(action.payload).toEqual({ ...payload, menuCoords: { x: 150, y: 300 } });

Просмотреть файл

@ -4,8 +4,7 @@
"@babel/preset-env",
{
"targets": {
"chrome": "68",
"esmodules": true
"chrome": "79"
}
}
],

Просмотреть файл

@ -11,7 +11,7 @@
"@bfemulator/sdk-client": "^1.0.0",
"@bfemulator/sdk-shared": "^1.0.0",
"@bfemulator/ui-react": "^1.0.0",
"botframework-schema": "4.14.0",
"botframework-schema": "^4.14.0",
"deep-diff": "^1.0.2",
"eslint-plugin-security": "^1.4.0",
"react": "16.8.6",
@ -26,14 +26,14 @@
"test": "jest"
},
"devDependencies": {
"@babel/cli": "^7.1.0",
"@babel/core": "^7.1.0",
"@babel/plugin-proposal-class-properties": "^7.1.0",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
"@babel/plugin-transform-react-jsx": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.4.4",
"@babel/preset-env": "^7.11.0",
"@babel/preset-typescript": "^7.1.0",
"@babel/core": "^7.20.2",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-decorators": "^7.20.7",
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
"@babel/plugin-transform-react-jsx": "^7.20.7",
"@babel/plugin-transform-runtime": "^7.19.6",
"@babel/preset-env": "^7.20.2",
"@babel/preset-typescript": "^7.18.6",
"@types/deep-diff": "^1.0.0",
"@types/jest": "24.0.13",
"@types/lscache": "^1.0.29",
@ -42,36 +42,39 @@
"@typescript-eslint/eslint-plugin": "^4.14.2",
"@typescript-eslint/parser": "^4.14.2",
"babel-eslint": "^10.0.1",
"babel-jest": "24.8.0",
"babel-jest": "^29.3.1",
"babel-loader": "^8.0.6",
"babel-preset-react-app": "^3.1.1",
"copy-webpack-plugin": "5.0.5",
"copy-webpack-plugin": "^6.4.1",
"css-loader": "^1.0.1",
"enzyme": "^3.3.0",
"eslint": "7.19.0",
"eslint-config-prettier": "^3.5.0",
"eslint-plugin-import": "2.20.0",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-notice": "^0.7.7",
"eslint-plugin-prettier": "^3.0.1",
"file-loader": "^1.1.11",
"jest": "24.8.0",
"jest-enzyme": "^7.0.0",
"resolve-url-loader": "^2.3.0",
"sass-loader": "^7.1.0",
"jest": "^29.3.1",
"jest-environment-jsdom": "^29.3.1",
"resolve-url-loader": "^5.0.0",
"sass-loader": "^10.4.1",
"typescript": "4.1.3",
"typings-for-css-modules-loader": "^1.7.0",
"webpack": "^4.32.2",
"webpack-cli": "^3.3.2",
"webpack-dev-server": "^3.4.1"
"webpack-dev-server": "^4.11.1"
},
"jest": {
"setupFilesAfterEnv": [
"../../../../testSetup.js"
],
"setupFilesAfterEnv": ["../../../../testSetup.js"],
"transform": {
"^.+\\.(tsx?|jsx?)$": "babel-jest"
"^.+\\.(tsx?|jsx?)$": "babel-jest",
"^.+\\.(ts?|js?)$": "babel-jest"
},
"testEnvironment": "jsdom",
"testEnvironmentOptions": {
"customExportConditions": ["node"],
"url": "http://localhost"
},
"testURL": "http://localhost",
"rootDir": "./src",
"testMatch": [
"**/?(*.)(spec|test).(ts)?(x)"

Просмотреть файл

@ -1,6 +1,39 @@
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Bot Framework: http://botframework.com
//
// Bot Framework Emulator Github:
// https://github.com/Microsoft/BotFramwork-Emulator
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
const path = require('path');
const { WatchIgnorePlugin } = require('webpack');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const path = require('path');
module.exports = {
entry: {
index: path.resolve('./src/index.tsx'),
@ -70,6 +103,6 @@ module.exports = {
externals: {},
plugins: [
new WatchIgnorePlugin(['./build/**/*.*', './public/**/*.*', './src/**/*.d.ts']),
new CopyWebpackPlugin([{ from: './src/index.html', to: './index.html' }]),
new CopyWebpackPlugin({ patterns: [{ from: './src/index.html', to: './index.html' }] }),
],
};

Просмотреть файл

@ -0,0 +1,28 @@
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"chrome": "79"
}
}
],
"@babel/preset-typescript"
],
"ignore": [
"**/*.d.ts"
],
"sourceMaps": "inline",
"plugins": [
"@babel/plugin-transform-react-jsx",
[
"@babel/proposal-decorators",
{
"decoratorsBeforeExport": true
}
],
"@babel/plugin-proposal-class-properties",
"@babel/plugin-transform-runtime"
]
}

Просмотреть файл

@ -11,7 +11,7 @@
"@bfemulator/sdk-shared": "^1.0.0",
"@bfemulator/ui-react": "^1.0.0",
"botframework-config": "4.4.0",
"botframework-schema": "4.14.0",
"botframework-schema": "4.17.0",
"eslint-plugin-security": "^1.4.0",
"lscache": "^1.1.0",
"luis-apis": "2.5.1",
@ -26,37 +26,37 @@
"test": ""
},
"devDependencies": {
"@babel/cli": "^7.1.0",
"@babel/core": "^7.1.0",
"@babel/plugin-proposal-class-properties": "^7.1.0",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
"@babel/plugin-transform-react-jsx": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.4.4",
"@babel/preset-env": "^7.11.0",
"@babel/preset-typescript": "^7.1.0",
"@babel/core": "^7.20.2",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-decorators": "^7.20.7",
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
"@babel/plugin-transform-react-jsx": "^7.20.7",
"@babel/plugin-transform-runtime": "^7.19.6",
"@babel/preset-env": "^7.20.2",
"@babel/preset-typescript": "^7.18.6",
"@types/jest": "24.0.13",
"@types/lscache": "^1.0.29",
"@types/react": "16.9.17",
"@types/react-dom": "16.9.4",
"@typescript-eslint/eslint-plugin": "^4.14.2",
"@typescript-eslint/parser": "^4.14.2",
"babel-jest": "24.8.0",
"babel-jest": "^29.3.1",
"babel-loader": "^8.0.6",
"copy-webpack-plugin": "5.0.5",
"copy-webpack-plugin": "^6.4.1",
"css-loader": "^1.0.1",
"eslint": "7.19.0",
"eslint-config-prettier": "^3.5.0",
"eslint-plugin-import": "2.20.0",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-notice": "^0.7.7",
"eslint-plugin-prettier": "^3.0.1",
"file-loader": "^1.1.11",
"jest": "24.8.0",
"resolve-url-loader": "^2.3.0",
"sass-loader": "^7.1.0",
"jest": "^29.3.1",
"resolve-url-loader": "^5.0.0",
"sass-loader": "^10.4.1",
"typescript": "4.1.3",
"typings-for-css-modules-loader": "^1.7.0",
"webpack": "^4.32.2",
"webpack-cli": "^3.3.2",
"webpack-dev-server": "^3.4.1"
"webpack-dev-server": "^4.11.1"
}
}

Просмотреть файл

@ -104,20 +104,22 @@ module.exports = {
externals: {},
plugins: [
new WatchIgnorePlugin(['./build/**/*.*', './public/**/*.*', './src/**/*.d.ts']),
new CopyWebpackPlugin([
{
from: './src/styles/themes/light-luis.css',
to: './themes/light-luis.css',
},
{
from: './src/styles/themes/dark-luis.css',
to: './themes/dark-luis.css',
},
{
from: './src/styles/themes/high-contrast-luis.css',
to: './themes/high-contrast-luis.css',
},
]),
new CopyWebpackPlugin({
patterns: [
{
from: './src/styles/themes/light-luis.css',
to: './themes/light-luis.css',
},
{
from: './src/styles/themes/dark-luis.css',
to: './themes/dark-luis.css',
},
{
from: './src/styles/themes/high-contrast-luis.css',
to: './themes/high-contrast-luis.css',
},
],
}),
new DefinePlugin({
process: { env: {} },
}),

Просмотреть файл

@ -10,8 +10,36 @@
"license": "ISC",
"devDependencies": {
"@types/jest": "24.0.13",
"babel-jest": "24.8.0",
"jest": "24.8.0"
"babel-jest": "^29.3.1",
"jest": "^29.3.1"
},
"jest": {
"setupFilesAfterEnv": ["../../../../testSetup.js"],
"transform": {
"^.+\\.(tsx?|jsx?)$": "babel-jest",
"^.+\\.(ts?|js?)$": "babel-jest"
},
"testEnvironment": "jsdom",
"testEnvironmentOptions": {
"customExportConditions": ["node"],
"url": "http://localhost"
},
"rootDir": "./client",
"testMatch": [
"**/?(*.)(spec|test).(ts)?(x)"
],
"moduleNameMapper": {
"monaco-editor": "<rootDir>/../../../../jestMocks/monacoEditorMock.js",
".\\.scss$": "<rootDir>/../../../../jestMocks/styleMock.js"
},
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"jsx",
"json",
"node"
]
},
"dependencies": {
"@babel/runtime": "^7.1.5",

Просмотреть файл

@ -4,7 +4,7 @@
"@babel/preset-env",
{
"targets": {
"chrome": "68"
"chrome": "79"
}
}
],

Просмотреть файл

@ -10,7 +10,7 @@
"@bfemulator/ui-react": "^1.0.0",
"@uifabric/merge-styles": "^6.2.0",
"botframework-config": "4.4.0",
"botframework-schema": "4.14.0",
"botframework-schema": "4.17.0",
"eslint-plugin-security": "^1.4.0",
"qnamaker": "^1.3.0",
"react": "16.8.6",
@ -25,14 +25,14 @@
"test": ""
},
"devDependencies": {
"@babel/cli": "^7.1.0",
"@babel/core": "^7.1.0",
"@babel/plugin-proposal-class-properties": "^7.1.0",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
"@babel/plugin-transform-react-jsx": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.4.4",
"@babel/preset-env": "^7.11.0",
"@babel/preset-typescript": "^7.1.0",
"@babel/core": "^7.20.2",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-decorators": "^7.20.7",
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
"@babel/plugin-transform-react-jsx": "^7.20.7",
"@babel/plugin-transform-runtime": "^7.19.6",
"@babel/preset-env": "^7.20.2",
"@babel/preset-typescript": "^7.18.6",
"@babel/runtime": "^7.1.5",
"@types/jest": "24.0.13",
"@types/node": "8.9.3",
@ -40,25 +40,24 @@
"@types/react-dom": "16.9.4",
"@typescript-eslint/eslint-plugin": "^4.14.2",
"@typescript-eslint/parser": "^4.14.2",
"babel-jest": "24.8.0",
"babel-jest": "^29.3.1",
"cross-env": "^5.1.3",
"css-loader": "^1.0.1",
"eslint": "7.19.0",
"eslint-config-prettier": "^3.5.0",
"eslint-plugin-import": "2.20.0",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-notice": "^0.7.7",
"eslint-plugin-prettier": "^3.0.1",
"file-loader": "^1.1.11",
"hard-source-webpack-plugin": "^0.12.0",
"jest": "24.8.0",
"resolve-url-loader": "^2.3.0",
"sass-loader": "^7.1.0",
"jest": "^29.3.1",
"resolve-url-loader": "^5.0.0",
"sass-loader": "^10.4.1",
"style-loader": "^0.21.0",
"terser-webpack-plugin": "2.3.3",
"typescript": "4.1.3",
"typings-for-css-modules-loader": "^1.7.0",
"webpack": "^4.32.2",
"webpack-cli": "^3.3.2",
"webpack-dev-server": "^3.4.1"
"webpack-dev-server": "^4.11.1"
}
}

Просмотреть файл

@ -31,9 +31,10 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
const path = require('path');
const { WatchIgnorePlugin } = require('webpack');
const TerserWebpackPlugin = require('terser-webpack-plugin');
const path = require('path');
const buildConfig = mode => {
const config = {
@ -72,7 +73,12 @@ const buildConfig = mode => {
},
},
'resolve-url-loader',
'sass-loader',
{
loader: 'sass-loader',
options: {
sourceMap: true,
},
},
],
},
{

Просмотреть файл

@ -4,15 +4,15 @@
"description": "",
"main": "index.js",
"scripts": {
"test": "jest",
"test": "jest --passWithNoTests",
"build:client": "cd ./client && npm run build"
},
"author": "",
"license": "ISC",
"devDependencies": {
"@types/jest": "24.0.13",
"babel-jest": "24.8.0",
"jest": "24.8.0",
"babel-jest": "^29.3.1",
"jest": "^29.3.1",
"webpack-cli": "^3.3.2"
},
"dependencies": {

Просмотреть файл

@ -11,29 +11,29 @@
"lint": "eslint --color --quiet --ext .js,.jsx,.ts,.tsx ./src",
"lint:fix": "npm run lint -- --fix",
"prepare": "npm run clean",
"test": "jest"
"test": "jest --passWithNoTests"
},
"author": "",
"license": "ISC",
"devDependencies": {
"@babel/cli": "^7.1.0",
"@babel/core": "^7.1.0",
"@babel/plugin-proposal-class-properties": "^7.1.0",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
"@babel/plugin-transform-react-jsx": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.4.4",
"@babel/preset-env": "^7.11.0",
"@babel/preset-typescript": "^7.1.0",
"@babel/core": "^7.20.2",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-decorators": "^7.20.7",
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
"@babel/plugin-transform-react-jsx": "^7.20.7",
"@babel/plugin-transform-runtime": "^7.19.6",
"@babel/preset-env": "^7.20.2",
"@babel/preset-typescript": "^7.18.6",
"@types/jest": "24.0.13",
"@typescript-eslint/eslint-plugin": "^4.14.2",
"@typescript-eslint/parser": "^4.14.2",
"babel-jest": "24.8.0",
"babel-jest": "^29.3.1",
"eslint": "7.19.0",
"eslint-config-prettier": "^3.5.0",
"eslint-plugin-import": "2.20.0",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-notice": "^0.7.7",
"eslint-plugin-prettier": "^3.0.1",
"jest": "24.8.0",
"jest": "^29.3.1",
"prettier-eslint": "^8.8.2",
"prettier-eslint-cli": "5.0.0",
"rimraf": "^2.6.2",
@ -43,7 +43,7 @@
"@babel/runtime": "^7.1.5",
"@bfemulator/sdk-shared": "^1.0.0",
"botframework-config": "4.4.0",
"botframework-schema": "4.14.0",
"botframework-schema": "4.17.0",
"eslint-plugin-security": "^1.4.0",
"tslib": "^1.9.0"
}

Просмотреть файл

@ -17,25 +17,24 @@
"author": "",
"license": "ISC",
"devDependencies": {
"@babel/cli": "^7.1.0",
"@babel/core": "^7.1.0",
"@babel/plugin-proposal-class-properties": "^7.1.0",
"@babel/plugin-proposal-decorators": "^7.4.0",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
"@babel/plugin-transform-react-jsx": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.4.4",
"@babel/preset-env": "^7.11.0",
"@babel/preset-typescript": "^7.1.0",
"@babel/core": "^7.20.2",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-decorators": "^7.20.7",
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
"@babel/plugin-transform-react-jsx": "^7.20.7",
"@babel/plugin-transform-runtime": "^7.19.6",
"@babel/preset-env": "^7.20.2",
"@babel/preset-typescript": "^7.18.6",
"@types/jest": "24.0.13",
"@typescript-eslint/eslint-plugin": "^4.14.2",
"@typescript-eslint/parser": "^4.14.2",
"babel-jest": "24.8.0",
"babel-jest": "^29.3.1",
"eslint": "7.19.0",
"eslint-config-prettier": "^3.5.0",
"eslint-plugin-import": "2.20.0",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-notice": "^0.7.7",
"eslint-plugin-prettier": "^3.0.1",
"jest": "24.8.0",
"jest": "^29.3.1",
"prettier-eslint": "^8.8.2",
"prettier-eslint-cli": "5.0.0",
"rimraf": "^2.6.2",
@ -44,14 +43,21 @@
"dependencies": {
"@babel/runtime": "^7.1.5",
"botframework-config": "4.4.0",
"botframework-schema": "4.14.0",
"botframework-schema": "4.17.0",
"eslint-plugin-security": "^1.4.0",
"tslib": "^1.9.0",
"uuid": "^3.3.2"
},
"jest": {
"setupFilesAfterEnv": ["../../../../testSetup.js"],
"transform": {
"^.+\\.(tsx?|jsx?)$": "babel-jest"
"^.+\\.(tsx?|jsx?)$": "babel-jest",
"^.+\\.(ts?|js?)$": "babel-jest"
},
"testEnvironment": "jsdom",
"testEnvironmentOptions": {
"customExportConditions": ["node"],
"url": "http://localhost"
},
"rootDir": "./src",
"testMatch": [

Просмотреть файл

@ -34,7 +34,6 @@
import { EventEmitter } from 'events';
import { uniqueId } from '../utils';
import { CommandRegistry, CommandRegistryImpl } from '..';
interface Sender {

Просмотреть файл

@ -17,37 +17,37 @@
"author": "",
"license": "ISC",
"devDependencies": {
"@babel/cli": "^7.1.0",
"@babel/core": "^7.1.0",
"@babel/plugin-proposal-class-properties": "^7.1.0",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
"@babel/plugin-transform-react-jsx": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.4.4",
"@babel/preset-env": "^7.11.0",
"@babel/preset-typescript": "^7.1.0",
"@babel/core": "^7.20.2",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-decorators": "^7.20.7",
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
"@babel/plugin-transform-react-jsx": "^7.20.7",
"@babel/plugin-transform-runtime": "^7.19.6",
"@babel/preset-env": "^7.20.2",
"@babel/preset-typescript": "^7.18.6", "css-loader": "^1.0.1",
"@types/jest": "24.0.13",
"@types/react": "16.9.17",
"@types/react-dom": "16.9.4",
"@typescript-eslint/eslint-plugin": "^4.14.2",
"@typescript-eslint/parser": "^4.14.2",
"babel-jest": "24.8.0",
"babel-jest": "^29.3.1",
"babel-loader": "^8.0.6",
"enzyme": "^3.3.0",
"eslint": "7.19.0",
"eslint-config-prettier": "^3.5.0",
"eslint-plugin-import": "2.20.0",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-notice": "^0.7.7",
"eslint-plugin-prettier": "^3.0.1",
"eslint-plugin-react": "^7.12.3",
"file-loader": "^1.1.11",
"jest": "24.8.0",
"jest": "^29.3.1",
"npm-run-all": "^4.1.5",
"prettier-eslint": "^8.8.2",
"prettier-eslint-cli": "5.0.0",
"react-hot-loader": "^4.1.3",
"resolve-url-loader": "^2.3.0",
"resolve-url-loader": "^5.0.0",
"rimraf": "^2.6.2",
"sass-loader": "^7.1.0",
"sass-loader": "^10.4.1",
"typescript": "4.1.3",
"typings-for-css-modules-loader": "^1.7.0",
"url-loader": "^1.0.1",
@ -62,15 +62,20 @@
"react-dom": "16.8.6"
},
"jest": {
"setupTestFrameworkScriptFile": "../../../../testSetup.js",
"setupFilesAfterEnv": ["../../../../testSetup.js"],
"transform": {
"^.+\\.(tsx?|jsx?)$": "babel-jest"
"^.+\\.(tsx?|jsx?)$": "babel-jest",
"^.+\\.(ts?|js?)$": "babel-jest"
},
"testEnvironment": "jsdom",
"testEnvironmentOptions": {
"customExportConditions": ["node"],
"url": "http://localhost"
},
"testURL": "http://localhost",
"rootDir": "./src",
"testMatch": [
"**/?(*.)(spec|test).(ts)?(x)"
],
],
"moduleNameMapper": {
".\\.scss$": "<rootDir>/../../../../jestMocks/styleMock.js"
},

Просмотреть файл

@ -36,7 +36,7 @@ import { mount } from 'enzyme';
import { DefaultButton } from './defaultButton';
import { LinkButton } from './linkButton';
import { PrimaryButton } from './PrimaryButton';
import { PrimaryButton } from './primaryButton';
describe('The DefaultButton component', () => {
let parent;

Просмотреть файл

@ -67,7 +67,7 @@ describe('<MenuButton />', () => {
(instance as any).onButtonClick();
expect(dispatchEventSpy).toHaveBeenCalledWith(
new CustomEvent('MenuButtonExpanded', { detail: jasmine.any(String) })
new CustomEvent('MenuButtonExpanded', { detail: expect.any(String) })
);
expect(wrapper.state().menuShowing).toBe(true);

Просмотреть файл

@ -75,7 +75,7 @@ describe('<SplitButton>', () => {
const mockButtonRef = jest.fn(() => null);
wrapper = mount(<SplitButton buttonRef={mockButtonRef} />);
expect(mockButtonRef).toHaveBeenCalledWith(jasmine.any(HTMLButtonElement));
expect(mockButtonRef).toHaveBeenCalledWith(expect.any(HTMLButtonElement));
});
it('should set a caret button ref', () => {

Просмотреть файл

@ -1,5 +1,39 @@
const { WatchIgnorePlugin } = require('webpack');
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Bot Framework: http://botframework.com
//
// Bot Framework Emulator Github:
// https://github.com/Microsoft/BotFramwork-Emulator
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
const path = require('path');
const { WatchIgnorePlugin } = require('webpack');
module.exports = {
target: 'electron-renderer',

Просмотреть файл

@ -9,15 +9,15 @@
"author": "",
"license": "ISC",
"dependencies": {
"botbuilder": "4.5.1",
"botbuilder": "^4.5.1",
"dotenv": "8.0.0",
"eslint-plugin-security": "^1.4.0",
"restify": "8.3.3"
"restify": "^8.4.0"
},
"devDependencies": {
"eslint": "6.0.1",
"eslint": "^7.19.0",
"eslint-config-standard": "13.0.1",
"eslint-plugin-import": "2.20.0",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-node": "9.1.0",
"eslint-plugin-promise": "4.2.1",
"eslint-plugin-standard": "4.0.0"

Просмотреть файл

@ -69,12 +69,14 @@ window.TextDecoder = class {
}
};
window.crypto = {
random: () => Math.random() * 1000,
subtle: {
digest: async () => Promise.resolve('Hi! I am in your digest'),
},
};
Object.defineProperty(window, 'crypto', {
get: () => ({
random: () => Math.random() * 1000,
subtle: {
digest: async () => Promise.resolve('Hi! I am in your digest'),
},
}),
});
window.MutationObserver = class {
observe() {}