Auto fix new import lint rules
This commit is contained in:
Родитель
f29749a93d
Коммит
5e39e6803f
|
@ -4,11 +4,11 @@
|
||||||
import { FunctionCallback } from '@azure/functions-core';
|
import { FunctionCallback } from '@azure/functions-core';
|
||||||
import { AzureFunctionsRpcMessages as rpc } from '../azure-functions-language-worker-protobuf/src/rpc';
|
import { AzureFunctionsRpcMessages as rpc } from '../azure-functions-language-worker-protobuf/src/rpc';
|
||||||
import { RegisteredFunction } from './AppContext';
|
import { RegisteredFunction } from './AppContext';
|
||||||
import { worker } from './WorkerContext';
|
|
||||||
import { AzFuncSystemError } from './errors';
|
import { AzFuncSystemError } from './errors';
|
||||||
import { loadScriptFile } from './loadScriptFile';
|
import { loadScriptFile } from './loadScriptFile';
|
||||||
import { PackageJson } from './parsers/parsePackageJson';
|
import { PackageJson } from './parsers/parsePackageJson';
|
||||||
import { nonNullProp } from './utils/nonNull';
|
import { nonNullProp } from './utils/nonNull';
|
||||||
|
import { worker } from './WorkerContext';
|
||||||
|
|
||||||
export async function loadLegacyFunction(
|
export async function loadLegacyFunction(
|
||||||
functionId: string,
|
functionId: string,
|
||||||
|
|
|
@ -2,14 +2,14 @@
|
||||||
// Licensed under the MIT License.
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
import * as parseArgs from 'minimist';
|
import * as parseArgs from 'minimist';
|
||||||
import { CreateGrpcEventStream } from './GrpcClient';
|
|
||||||
import { worker } from './WorkerContext';
|
|
||||||
import { AzFuncSystemError, ensureErrorType } from './errors';
|
import { AzFuncSystemError, ensureErrorType } from './errors';
|
||||||
|
import { CreateGrpcEventStream } from './GrpcClient';
|
||||||
import { setupCoreModule } from './setupCoreModule';
|
import { setupCoreModule } from './setupCoreModule';
|
||||||
import { setupEventStream } from './setupEventStream';
|
import { setupEventStream } from './setupEventStream';
|
||||||
import { systemError, systemLog } from './utils/Logger';
|
|
||||||
import { startBlockedMonitor } from './utils/blockedMonitor';
|
import { startBlockedMonitor } from './utils/blockedMonitor';
|
||||||
|
import { systemError, systemLog } from './utils/Logger';
|
||||||
import { isEnvironmentVariableSet } from './utils/util';
|
import { isEnvironmentVariableSet } from './utils/util';
|
||||||
|
import { worker } from './WorkerContext';
|
||||||
|
|
||||||
export function startNodeWorker(args) {
|
export function startNodeWorker(args) {
|
||||||
const parsedArgs = parseArgs(args.slice(2));
|
const parsedArgs = parseArgs(args.slice(2));
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
import { ProgrammingModel } from '@azure/functions-core';
|
import { ProgrammingModel } from '@azure/functions-core';
|
||||||
import { AzureFunctionsRpcMessages as rpc } from '../azure-functions-language-worker-protobuf/src/rpc';
|
import { AzureFunctionsRpcMessages as rpc } from '../azure-functions-language-worker-protobuf/src/rpc';
|
||||||
import { AppContext } from './AppContext';
|
import { AppContext } from './AppContext';
|
||||||
import { IEventStream } from './GrpcClient';
|
|
||||||
import { AzFuncSystemError } from './errors';
|
import { AzFuncSystemError } from './errors';
|
||||||
|
import { IEventStream } from './GrpcClient';
|
||||||
|
|
||||||
class WorkerContext {
|
class WorkerContext {
|
||||||
app = new AppContext();
|
app = new AppContext();
|
||||||
|
|
|
@ -5,8 +5,8 @@ import { FunctionCallback, FunctionMetadata } from '@azure/functions-core';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import { AzureFunctionsRpcMessages as rpc } from '../../azure-functions-language-worker-protobuf/src/rpc';
|
import { AzureFunctionsRpcMessages as rpc } from '../../azure-functions-language-worker-protobuf/src/rpc';
|
||||||
import { Disposable } from '../Disposable';
|
import { Disposable } from '../Disposable';
|
||||||
import { worker } from '../WorkerContext';
|
|
||||||
import { AzFuncSystemError } from '../errors';
|
import { AzFuncSystemError } from '../errors';
|
||||||
|
import { worker } from '../WorkerContext';
|
||||||
import { fromCoreFunctionMetadata } from './converters/fromCoreFunctionMetadata';
|
import { fromCoreFunctionMetadata } from './converters/fromCoreFunctionMetadata';
|
||||||
|
|
||||||
export function registerFunction(metadata: FunctionMetadata, callback: FunctionCallback): Disposable {
|
export function registerFunction(metadata: FunctionMetadata, callback: FunctionCallback): Disposable {
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
// Licensed under the MIT License.
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
import { AzureFunctionsRpcMessages as rpc } from '../../azure-functions-language-worker-protobuf/src/rpc';
|
import { AzureFunctionsRpcMessages as rpc } from '../../azure-functions-language-worker-protobuf/src/rpc';
|
||||||
import { worker } from '../WorkerContext';
|
|
||||||
import { startApp } from '../startApp';
|
import { startApp } from '../startApp';
|
||||||
|
import { worker } from '../WorkerContext';
|
||||||
import { EventHandler } from './EventHandler';
|
import { EventHandler } from './EventHandler';
|
||||||
import { getWorkerCapabilities } from './getWorkerCapabilities';
|
import { getWorkerCapabilities } from './getWorkerCapabilities';
|
||||||
import { getWorkerMetadata } from './getWorkerMetadata';
|
import { getWorkerMetadata } from './getWorkerMetadata';
|
||||||
|
|
|
@ -2,10 +2,10 @@
|
||||||
// Licensed under the MIT License.
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
import { AzureFunctionsRpcMessages as rpc } from '../../azure-functions-language-worker-protobuf/src/rpc';
|
import { AzureFunctionsRpcMessages as rpc } from '../../azure-functions-language-worker-protobuf/src/rpc';
|
||||||
import { loadLegacyFunction } from '../LegacyFunctionLoader';
|
|
||||||
import { worker } from '../WorkerContext';
|
|
||||||
import { ensureErrorType } from '../errors';
|
import { ensureErrorType } from '../errors';
|
||||||
|
import { loadLegacyFunction } from '../LegacyFunctionLoader';
|
||||||
import { isDefined, nonNullProp } from '../utils/nonNull';
|
import { isDefined, nonNullProp } from '../utils/nonNull';
|
||||||
|
import { worker } from '../WorkerContext';
|
||||||
import { EventHandler } from './EventHandler';
|
import { EventHandler } from './EventHandler';
|
||||||
import LogCategory = rpc.RpcLog.RpcLogCategory;
|
import LogCategory = rpc.RpcLog.RpcLogCategory;
|
||||||
import LogLevel = rpc.RpcLog.Level;
|
import LogLevel = rpc.RpcLog.Level;
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
// Licensed under the MIT License.
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
import { AzureFunctionsRpcMessages as rpc } from '../../azure-functions-language-worker-protobuf/src/rpc';
|
import { AzureFunctionsRpcMessages as rpc } from '../../azure-functions-language-worker-protobuf/src/rpc';
|
||||||
import { worker } from '../WorkerContext';
|
|
||||||
import { isDefined } from '../utils/nonNull';
|
import { isDefined } from '../utils/nonNull';
|
||||||
|
import { worker } from '../WorkerContext';
|
||||||
import { EventHandler } from './EventHandler';
|
import { EventHandler } from './EventHandler';
|
||||||
import LogCategory = rpc.RpcLog.RpcLogCategory;
|
import LogCategory = rpc.RpcLog.RpcLogCategory;
|
||||||
import LogLevel = rpc.RpcLog.Level;
|
import LogLevel = rpc.RpcLog.Level;
|
||||||
|
|
|
@ -15,15 +15,15 @@ import {
|
||||||
} from '@azure/functions-core';
|
} from '@azure/functions-core';
|
||||||
import { AzureFunctionsRpcMessages as rpc } from '../../azure-functions-language-worker-protobuf/src/rpc';
|
import { AzureFunctionsRpcMessages as rpc } from '../../azure-functions-language-worker-protobuf/src/rpc';
|
||||||
import { RegisteredFunction } from '../AppContext';
|
import { RegisteredFunction } from '../AppContext';
|
||||||
import { getLegacyFunction } from '../LegacyFunctionLoader';
|
|
||||||
import { worker } from '../WorkerContext';
|
|
||||||
import { fromCoreInvocationResponse } from '../coreApi/converters/fromCoreInvocationResponse';
|
import { fromCoreInvocationResponse } from '../coreApi/converters/fromCoreInvocationResponse';
|
||||||
import { fromCoreLogCategory, fromCoreLogLevel } from '../coreApi/converters/fromCoreStatusResult';
|
import { fromCoreLogCategory, fromCoreLogLevel } from '../coreApi/converters/fromCoreStatusResult';
|
||||||
import { toCoreFunctionMetadata } from '../coreApi/converters/toCoreFunctionMetadata';
|
import { toCoreFunctionMetadata } from '../coreApi/converters/toCoreFunctionMetadata';
|
||||||
import { toCoreInvocationRequest } from '../coreApi/converters/toCoreInvocationRequest';
|
import { toCoreInvocationRequest } from '../coreApi/converters/toCoreInvocationRequest';
|
||||||
import { AzFuncSystemError, ReadOnlyError, isError } from '../errors';
|
import { AzFuncSystemError, isError, ReadOnlyError } from '../errors';
|
||||||
import { executeHooks } from '../hooks/executeHooks';
|
import { executeHooks } from '../hooks/executeHooks';
|
||||||
|
import { getLegacyFunction } from '../LegacyFunctionLoader';
|
||||||
import { nonNullProp } from '../utils/nonNull';
|
import { nonNullProp } from '../utils/nonNull';
|
||||||
|
import { worker } from '../WorkerContext';
|
||||||
import { EventHandler } from './EventHandler';
|
import { EventHandler } from './EventHandler';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -4,10 +4,10 @@
|
||||||
import { access, constants } from 'fs';
|
import { access, constants } from 'fs';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import { AzureFunctionsRpcMessages as rpc } from '../../azure-functions-language-worker-protobuf/src/rpc';
|
import { AzureFunctionsRpcMessages as rpc } from '../../azure-functions-language-worker-protobuf/src/rpc';
|
||||||
import { worker } from '../WorkerContext';
|
|
||||||
import { isError } from '../errors';
|
import { isError } from '../errors';
|
||||||
import { startApp } from '../startApp';
|
import { startApp } from '../startApp';
|
||||||
import { nonNullProp } from '../utils/nonNull';
|
import { nonNullProp } from '../utils/nonNull';
|
||||||
|
import { worker } from '../WorkerContext';
|
||||||
import { EventHandler } from './EventHandler';
|
import { EventHandler } from './EventHandler';
|
||||||
import { getWorkerCapabilities } from './getWorkerCapabilities';
|
import { getWorkerCapabilities } from './getWorkerCapabilities';
|
||||||
import { getWorkerMetadata } from './getWorkerMetadata';
|
import { getWorkerMetadata } from './getWorkerMetadata';
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
// Licensed under the MIT License.
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
import { AzureFunctionsRpcMessages as rpc } from '../../azure-functions-language-worker-protobuf/src/rpc';
|
import { AzureFunctionsRpcMessages as rpc } from '../../azure-functions-language-worker-protobuf/src/rpc';
|
||||||
import { worker } from '../WorkerContext';
|
|
||||||
import { version as workerVersion } from '../constants';
|
import { version as workerVersion } from '../constants';
|
||||||
|
import { worker } from '../WorkerContext';
|
||||||
|
|
||||||
export function getWorkerMetadata(): rpc.IWorkerMetadata {
|
export function getWorkerMetadata(): rpc.IWorkerMetadata {
|
||||||
const result: rpc.IWorkerMetadata = {
|
const result: rpc.IWorkerMetadata = {
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
|
|
||||||
import { AppTerminateContext } from '@azure/functions-core';
|
import { AppTerminateContext } from '@azure/functions-core';
|
||||||
import { AzureFunctionsRpcMessages as rpc } from '../../azure-functions-language-worker-protobuf/src/rpc';
|
import { AzureFunctionsRpcMessages as rpc } from '../../azure-functions-language-worker-protobuf/src/rpc';
|
||||||
import { worker } from '../WorkerContext';
|
|
||||||
import { ReadOnlyError } from '../errors';
|
import { ReadOnlyError } from '../errors';
|
||||||
import { executeHooks } from '../hooks/executeHooks';
|
import { executeHooks } from '../hooks/executeHooks';
|
||||||
|
import { worker } from '../WorkerContext';
|
||||||
import LogCategory = rpc.RpcLog.RpcLogCategory;
|
import LogCategory = rpc.RpcLog.RpcLogCategory;
|
||||||
import LogLevel = rpc.RpcLog.Level;
|
import LogLevel = rpc.RpcLog.Level;
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
// Licensed under the MIT License.
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
import { HookCallback } from '@azure/functions-core';
|
import { HookCallback } from '@azure/functions-core';
|
||||||
import { worker } from '../WorkerContext';
|
|
||||||
import { AzFuncRangeError } from '../errors';
|
import { AzFuncRangeError } from '../errors';
|
||||||
|
import { worker } from '../WorkerContext';
|
||||||
|
|
||||||
export function getHooks(hookName: string): HookCallback[] {
|
export function getHooks(hookName: string): HookCallback[] {
|
||||||
switch (hookName) {
|
switch (hookName) {
|
||||||
|
|
|
@ -5,9 +5,9 @@ import * as retry from 'p-retry';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as url from 'url';
|
import * as url from 'url';
|
||||||
import { AzureFunctionsRpcMessages as rpc } from '../azure-functions-language-worker-protobuf/src/rpc';
|
import { AzureFunctionsRpcMessages as rpc } from '../azure-functions-language-worker-protobuf/src/rpc';
|
||||||
import { worker } from './WorkerContext';
|
|
||||||
import { AzFuncSystemError } from './errors';
|
import { AzFuncSystemError } from './errors';
|
||||||
import { PackageJson } from './parsers/parsePackageJson';
|
import { PackageJson } from './parsers/parsePackageJson';
|
||||||
|
import { worker } from './WorkerContext';
|
||||||
import LogCategory = rpc.RpcLog.RpcLogCategory;
|
import LogCategory = rpc.RpcLog.RpcLogCategory;
|
||||||
import LogLevel = rpc.RpcLog.Level;
|
import LogLevel = rpc.RpcLog.Level;
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
// Copyright (c) .NET Foundation. All rights reserved.
|
// Copyright (c) .NET Foundation. All rights reserved.
|
||||||
// Licensed under the MIT License.
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
import { Disposable } from './Disposable';
|
|
||||||
import { worker } from './WorkerContext';
|
|
||||||
import { version } from './constants';
|
import { version } from './constants';
|
||||||
import { coreApiLog } from './coreApi/coreApiLog';
|
import { coreApiLog } from './coreApi/coreApiLog';
|
||||||
import { registerFunction } from './coreApi/registerFunction';
|
import { registerFunction } from './coreApi/registerFunction';
|
||||||
import { setProgrammingModel } from './coreApi/setProgrammingModel';
|
import { setProgrammingModel } from './coreApi/setProgrammingModel';
|
||||||
|
import { Disposable } from './Disposable';
|
||||||
import { registerHook } from './hooks/registerHook';
|
import { registerHook } from './hooks/registerHook';
|
||||||
|
import { worker } from './WorkerContext';
|
||||||
import Module = require('module');
|
import Module = require('module');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
// Copyright (c) .NET Foundation. All rights reserved.
|
// Copyright (c) .NET Foundation. All rights reserved.
|
||||||
// Licensed under the MIT License.
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
import { expect } from 'chai';
|
|
||||||
import 'mocha';
|
import 'mocha';
|
||||||
|
import { expect } from 'chai';
|
||||||
import { startNodeWorker } from '../src/Worker';
|
import { startNodeWorker } from '../src/Worker';
|
||||||
|
|
||||||
describe('Worker', () => {
|
describe('Worker', () => {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
// Copyright (c) .NET Foundation. All rights reserved.
|
// Copyright (c) .NET Foundation. All rights reserved.
|
||||||
// Licensed under the MIT License.
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
import { expect } from 'chai';
|
|
||||||
import 'mocha';
|
import 'mocha';
|
||||||
|
import { expect } from 'chai';
|
||||||
import { AzureFunctionsRpcMessages as rpc } from './../azure-functions-language-worker-protobuf/src/rpc';
|
import { AzureFunctionsRpcMessages as rpc } from './../azure-functions-language-worker-protobuf/src/rpc';
|
||||||
import { startBlockedMonitor } from './../src/utils/blockedMonitor';
|
import { startBlockedMonitor } from './../src/utils/blockedMonitor';
|
||||||
import LogLevel = rpc.RpcLog.Level;
|
import LogLevel = rpc.RpcLog.Level;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
// Copyright (c) .NET Foundation. All rights reserved.
|
// Copyright (c) .NET Foundation. All rights reserved.
|
||||||
// Licensed under the MIT License.
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
import { expect } from 'chai';
|
|
||||||
import 'mocha';
|
import 'mocha';
|
||||||
|
import { expect } from 'chai';
|
||||||
import { ensureErrorType } from '../src/errors';
|
import { ensureErrorType } from '../src/errors';
|
||||||
|
|
||||||
describe('errors', () => {
|
describe('errors', () => {
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
// Copyright (c) .NET Foundation. All rights reserved.
|
// Copyright (c) .NET Foundation. All rights reserved.
|
||||||
// Licensed under the MIT License.
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
|
import 'mocha';
|
||||||
import { expect } from 'chai';
|
import { expect } from 'chai';
|
||||||
import * as fs from 'fs/promises';
|
import * as fs from 'fs/promises';
|
||||||
import 'mocha';
|
|
||||||
import { worker } from '../../src/WorkerContext';
|
import { worker } from '../../src/WorkerContext';
|
||||||
import { TestEventStream } from './TestEventStream';
|
|
||||||
import { beforeEventHandlerSuite } from './beforeEventHandlerSuite';
|
import { beforeEventHandlerSuite } from './beforeEventHandlerSuite';
|
||||||
import { msg } from './msg';
|
import { msg } from './msg';
|
||||||
import { setTestAppMainField, testAppPath, testAppSrcPath, testPackageJsonPath } from './testAppUtils';
|
import { setTestAppMainField, testAppPath, testAppSrcPath, testPackageJsonPath } from './testAppUtils';
|
||||||
|
import { TestEventStream } from './TestEventStream';
|
||||||
|
|
||||||
describe('FunctionEnvironmentReloadHandler', () => {
|
describe('FunctionEnvironmentReloadHandler', () => {
|
||||||
let stream: TestEventStream;
|
let stream: TestEventStream;
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
// Copyright (c) .NET Foundation. All rights reserved.
|
// Copyright (c) .NET Foundation. All rights reserved.
|
||||||
// Licensed under the MIT License.
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
|
import 'mocha';
|
||||||
import { expect } from 'chai';
|
import { expect } from 'chai';
|
||||||
import * as fs from 'fs/promises';
|
import * as fs from 'fs/promises';
|
||||||
import 'mocha';
|
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import { AzureFunctionsRpcMessages as rpc } from '../../azure-functions-language-worker-protobuf/src/rpc';
|
import { AzureFunctionsRpcMessages as rpc } from '../../azure-functions-language-worker-protobuf/src/rpc';
|
||||||
import { getLegacyFunction } from '../../src/LegacyFunctionLoader';
|
import { getLegacyFunction } from '../../src/LegacyFunctionLoader';
|
||||||
import { worker } from '../../src/WorkerContext';
|
|
||||||
import { delay } from '../../src/utils/delay';
|
import { delay } from '../../src/utils/delay';
|
||||||
import { nonNullValue } from '../../src/utils/nonNull';
|
import { nonNullValue } from '../../src/utils/nonNull';
|
||||||
import { RegExpStreamingMessage, TestEventStream } from './TestEventStream';
|
import { worker } from '../../src/WorkerContext';
|
||||||
import { beforeEventHandlerSuite } from './beforeEventHandlerSuite';
|
import { beforeEventHandlerSuite } from './beforeEventHandlerSuite';
|
||||||
import { msg } from './msg';
|
import { msg } from './msg';
|
||||||
import { tempFile, testAppSrcPath } from './testAppUtils';
|
import { tempFile, testAppSrcPath } from './testAppUtils';
|
||||||
|
import { RegExpStreamingMessage, TestEventStream } from './TestEventStream';
|
||||||
|
|
||||||
describe('FunctionLoadHandler', () => {
|
describe('FunctionLoadHandler', () => {
|
||||||
let stream: TestEventStream;
|
let stream: TestEventStream;
|
||||||
|
|
|
@ -3,16 +3,16 @@
|
||||||
|
|
||||||
/* eslint-disable deprecation/deprecation */
|
/* eslint-disable deprecation/deprecation */
|
||||||
|
|
||||||
|
import 'mocha';
|
||||||
import { AzureFunction, Context } from '@azure/functions';
|
import { AzureFunction, Context } from '@azure/functions';
|
||||||
import * as coreTypes from '@azure/functions-core';
|
import * as coreTypes from '@azure/functions-core';
|
||||||
import { expect } from 'chai';
|
import { expect } from 'chai';
|
||||||
import 'mocha';
|
|
||||||
import * as sinon from 'sinon';
|
import * as sinon from 'sinon';
|
||||||
import { AzureFunctionsRpcMessages as rpc } from '../../azure-functions-language-worker-protobuf/src/rpc';
|
import { AzureFunctionsRpcMessages as rpc } from '../../azure-functions-language-worker-protobuf/src/rpc';
|
||||||
import { worker } from '../../src/WorkerContext';
|
import { worker } from '../../src/WorkerContext';
|
||||||
import { TestEventStream } from './TestEventStream';
|
|
||||||
import { beforeEventHandlerSuite } from './beforeEventHandlerSuite';
|
import { beforeEventHandlerSuite } from './beforeEventHandlerSuite';
|
||||||
import { msg } from './msg';
|
import { msg } from './msg';
|
||||||
|
import { TestEventStream } from './TestEventStream';
|
||||||
import LogCategory = rpc.RpcLog.RpcLogCategory;
|
import LogCategory = rpc.RpcLog.RpcLogCategory;
|
||||||
import LogLevel = rpc.RpcLog.Level;
|
import LogLevel = rpc.RpcLog.Level;
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
// Copyright (c) .NET Foundation. All rights reserved.
|
// Copyright (c) .NET Foundation. All rights reserved.
|
||||||
// Licensed under the MIT License.
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
|
import 'mocha';
|
||||||
import * as coreTypes from '@azure/functions-core';
|
import * as coreTypes from '@azure/functions-core';
|
||||||
import { expect } from 'chai';
|
import { expect } from 'chai';
|
||||||
import * as fs from 'fs/promises';
|
import * as fs from 'fs/promises';
|
||||||
import 'mocha';
|
|
||||||
import { worker } from '../../src/WorkerContext';
|
|
||||||
import { logColdStartWarning } from '../../src/eventHandlers/WorkerInitHandler';
|
import { logColdStartWarning } from '../../src/eventHandlers/WorkerInitHandler';
|
||||||
import { isNode20Plus } from '../../src/utils/util';
|
import { isNode20Plus } from '../../src/utils/util';
|
||||||
import { TestEventStream } from './TestEventStream';
|
import { worker } from '../../src/WorkerContext';
|
||||||
import { beforeEventHandlerSuite } from './beforeEventHandlerSuite';
|
import { beforeEventHandlerSuite } from './beforeEventHandlerSuite';
|
||||||
import { msg } from './msg';
|
import { msg } from './msg';
|
||||||
import { setTestAppMainField, testAppPath, testPackageJsonPath } from './testAppUtils';
|
import { setTestAppMainField, testAppPath, testPackageJsonPath } from './testAppUtils';
|
||||||
|
import { TestEventStream } from './TestEventStream';
|
||||||
|
|
||||||
describe('WorkerInitHandler', () => {
|
describe('WorkerInitHandler', () => {
|
||||||
let stream: TestEventStream;
|
let stream: TestEventStream;
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
// Licensed under the MIT License.
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
import 'mocha';
|
import 'mocha';
|
||||||
import { TestEventStream } from './TestEventStream';
|
|
||||||
import { beforeEventHandlerSuite } from './beforeEventHandlerSuite';
|
import { beforeEventHandlerSuite } from './beforeEventHandlerSuite';
|
||||||
|
import { TestEventStream } from './TestEventStream';
|
||||||
|
|
||||||
describe('WorkerStatusHandler', () => {
|
describe('WorkerStatusHandler', () => {
|
||||||
let stream: TestEventStream;
|
let stream: TestEventStream;
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
// Copyright (c) .NET Foundation. All rights reserved.
|
// Copyright (c) .NET Foundation. All rights reserved.
|
||||||
// Licensed under the MIT License.
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
import { worker } from '../../src/WorkerContext';
|
|
||||||
import { setupCoreModule } from '../../src/setupCoreModule';
|
import { setupCoreModule } from '../../src/setupCoreModule';
|
||||||
import { setupEventStream } from '../../src/setupEventStream';
|
import { setupEventStream } from '../../src/setupEventStream';
|
||||||
|
import { worker } from '../../src/WorkerContext';
|
||||||
import { TestEventStream } from './TestEventStream';
|
import { TestEventStream } from './TestEventStream';
|
||||||
|
|
||||||
let testEventStream: TestEventStream | undefined;
|
let testEventStream: TestEventStream | undefined;
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
|
|
||||||
import 'mocha';
|
import 'mocha';
|
||||||
import { AzureFunctionsRpcMessages as rpc } from '../../azure-functions-language-worker-protobuf/src/rpc';
|
import { AzureFunctionsRpcMessages as rpc } from '../../azure-functions-language-worker-protobuf/src/rpc';
|
||||||
import { RegExpProps, RegExpStreamingMessage } from './TestEventStream';
|
|
||||||
import { testAppPath, testAppSrcPath } from './testAppUtils';
|
import { testAppPath, testAppSrcPath } from './testAppUtils';
|
||||||
|
import { RegExpProps, RegExpStreamingMessage } from './TestEventStream';
|
||||||
import LogCategory = rpc.RpcLog.RpcLogCategory;
|
import LogCategory = rpc.RpcLog.RpcLogCategory;
|
||||||
import LogLevel = rpc.RpcLog.Level;
|
import LogLevel = rpc.RpcLog.Level;
|
||||||
import escapeStringRegexp = require('escape-string-regexp');
|
import escapeStringRegexp = require('escape-string-regexp');
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
import * as coreTypes from '@azure/functions-core';
|
import * as coreTypes from '@azure/functions-core';
|
||||||
import { expect } from 'chai';
|
import { expect } from 'chai';
|
||||||
import { worker } from '../../src/WorkerContext';
|
import { worker } from '../../src/WorkerContext';
|
||||||
import { TestEventStream } from './TestEventStream';
|
|
||||||
import { beforeEventHandlerSuite } from './beforeEventHandlerSuite';
|
import { beforeEventHandlerSuite } from './beforeEventHandlerSuite';
|
||||||
import { msg } from './msg';
|
import { msg } from './msg';
|
||||||
|
import { TestEventStream } from './TestEventStream';
|
||||||
import sinon = require('sinon');
|
import sinon = require('sinon');
|
||||||
|
|
||||||
describe('terminateWorker', () => {
|
describe('terminateWorker', () => {
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
// Copyright (c) .NET Foundation. All rights reserved.
|
// Copyright (c) .NET Foundation. All rights reserved.
|
||||||
// Licensed under the MIT License.
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
import * as chai from 'chai';
|
|
||||||
import 'mocha';
|
import 'mocha';
|
||||||
|
import { expect } from 'chai';
|
||||||
import { isESModule } from '../src/loadScriptFile';
|
import { isESModule } from '../src/loadScriptFile';
|
||||||
const expect = chai.expect;
|
|
||||||
|
|
||||||
describe('loadScriptFile', () => {
|
describe('loadScriptFile', () => {
|
||||||
it('respects .cjs extension', () => {
|
it('respects .cjs extension', () => {
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
// Copyright (c) .NET Foundation. All rights reserved.
|
// Copyright (c) .NET Foundation. All rights reserved.
|
||||||
// Licensed under the MIT License.
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
|
import 'mocha';
|
||||||
import * as chai from 'chai';
|
import * as chai from 'chai';
|
||||||
import { expect } from 'chai';
|
import { expect } from 'chai';
|
||||||
import * as chaiAsPromised from 'chai-as-promised';
|
import * as chaiAsPromised from 'chai-as-promised';
|
||||||
import 'mocha';
|
|
||||||
import * as mockFs from 'mock-fs';
|
import * as mockFs from 'mock-fs';
|
||||||
import { parsePackageJson } from '../../src/parsers/parsePackageJson';
|
import { parsePackageJson } from '../../src/parsers/parsePackageJson';
|
||||||
|
|
||||||
chai.use(chaiAsPromised);
|
chai.use(chaiAsPromised);
|
||||||
|
|
||||||
describe('parsePackageJson', () => {
|
describe('parsePackageJson', () => {
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
// Copyright (c) .NET Foundation. All rights reserved.
|
// Copyright (c) .NET Foundation. All rights reserved.
|
||||||
// Licensed under the MIT License.
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
import 'mocha';
|
|
||||||
import { IHookCallbackContext, ITestCallbackContext } from 'mocha';
|
import { IHookCallbackContext, ITestCallbackContext } from 'mocha';
|
||||||
import { worker } from '../src/WorkerContext';
|
|
||||||
import { isNode20Plus } from '../src/utils/util';
|
import { isNode20Plus } from '../src/utils/util';
|
||||||
import { TestEventStream } from './eventHandlers/TestEventStream';
|
import { worker } from '../src/WorkerContext';
|
||||||
import { beforeEventHandlerSuite } from './eventHandlers/beforeEventHandlerSuite';
|
import { beforeEventHandlerSuite } from './eventHandlers/beforeEventHandlerSuite';
|
||||||
import { msg } from './eventHandlers/msg';
|
import { msg } from './eventHandlers/msg';
|
||||||
import { setTestAppMainField, testAppPath } from './eventHandlers/testAppUtils';
|
import { setTestAppMainField, testAppPath } from './eventHandlers/testAppUtils';
|
||||||
|
import { TestEventStream } from './eventHandlers/TestEventStream';
|
||||||
|
|
||||||
describe('startApp', () => {
|
describe('startApp', () => {
|
||||||
let stream: TestEventStream;
|
let stream: TestEventStream;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче