type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
ArrowFunction |
() => {
const onExecute: jest.Mock = jest.fn();
ktpTree.addNode({ ...keytipB, onExecute, hasDynamicChildren: true }, uniqueIdB);
ktpTree.currentKeytip = ktpTree.root;
layerValue.processInput('b');
// Node B's onExecute should be called
expect(onExecute).toBeCalled();
... | Augani/fluentui | packages/react/src/components/KeytipLayer/KeytipLayer.test.tsx | TypeScript |
ArrowFunction |
() => {
// Make E2 a persisted node
const nodeE2 = ktpTree.getNode(keytipIdE2)!;
nodeE2.persisted = true;
nodeE2.onExecute = jest.fn();
ktpTree.currentKeytip = ktpTree.root;
layerValue.processInput('e');
// Only E1 should be visible
const visibleLayerKtps... | Augani/fluentui | packages/react/src/components/KeytipLayer/KeytipLayer.test.tsx | TypeScript |
ArrowFunction |
() => {
// Create layer
it('shows the defined keytips and hides all others', () => {
ktpMgr.keytips = {
[uniqueIdB]: { keytip: keytipB, uniqueID: uniqueIdB },
[uniqueIdC]: { keytip: keytipC, uniqueID: uniqueIdC },
[uniqueIdD]: { keytip: keytipD, uniqueID: uniqueIdD },
[uni... | Augani/fluentui | packages/react/src/components/KeytipLayer/KeytipLayer.test.tsx | TypeScript |
ArrowFunction |
() => {
ktpMgr.keytips = {
[uniqueIdB]: { keytip: keytipB, uniqueID: uniqueIdB },
[uniqueIdC]: { keytip: keytipC, uniqueID: uniqueIdC },
[uniqueIdD]: { keytip: keytipD, uniqueID: uniqueIdD },
[uniqueIdE1]: { keytip: keytipE1, uniqueID: uniqueIdE1 },
[uniqueIdE2]: { keytip:... | Augani/fluentui | packages/react/src/components/KeytipLayer/KeytipLayer.test.tsx | TypeScript |
ArrowFunction |
() => {
ktpMgr.keytips = {
[uniqueIdB]: {
keytip: {
...keytipB,
overflowSetSequence: ['x'],
},
uniqueID: uniqueIdB,
},
[uniqueIdC]: { keytip: keytipC, uniqueID: uniqueIdC },
[uniqueIdD]: { keytip: keytipD, uniqueID: uniqueIdD }... | Augani/fluentui | packages/react/src/components/KeytipLayer/KeytipLayer.test.tsx | TypeScript |
ArrowFunction |
() => {
beforeEach(() => {
jest.useFakeTimers();
ktpMgr.delayUpdatingKeytipChange = false;
ktpMgr.inKeytipMode = false;
// Add keytips to the manager
ktpMgr.keytips = {
[uniqueIdB]: { keytip: keytipB, uniqueID: uniqueIdB },
[uniqueIdC]: { keytip: keytipC, uniqueID: un... | Augani/fluentui | packages/react/src/components/KeytipLayer/KeytipLayer.test.tsx | TypeScript |
ArrowFunction |
() => {
jest.useFakeTimers();
ktpMgr.delayUpdatingKeytipChange = false;
ktpMgr.inKeytipMode = false;
// Add keytips to the manager
ktpMgr.keytips = {
[uniqueIdB]: { keytip: keytipB, uniqueID: uniqueIdB },
[uniqueIdC]: { keytip: keytipC, uniqueID: uniqueIdC },
[uni... | Augani/fluentui | packages/react/src/components/KeytipLayer/KeytipLayer.test.tsx | TypeScript |
ArrowFunction |
() => {
jest.useRealTimers();
} | Augani/fluentui | packages/react/src/components/KeytipLayer/KeytipLayer.test.tsx | TypeScript |
ArrowFunction |
() => {
ktpTree.currentKeytip = ktpTree.getNode(keytipIdB);
// Add a child under B
ktpMgr.register({
content: 'X',
keySequences: ['b', 'x'],
});
jest.runAllTimers();
const visibleKeytips: IKeytipProps[] = ktpLayer.state('visibleKeytips');
expect(visibleKeytips... | Augani/fluentui | packages/react/src/components/KeytipLayer/KeytipLayer.test.tsx | TypeScript |
ArrowFunction |
() => {
ktpMgr.delayUpdatingKeytipChange = true;
ktpTree.currentKeytip = ktpTree.getNode(keytipIdB);
// Add a child under B
ktpMgr.register({
content: 'X',
keySequences: ['b', 'x'],
});
jest.runAllTimers();
const visibleKeytips: IKeytipProps[] = ktpLayer.state... | Augani/fluentui | packages/react/src/components/KeytipLayer/KeytipLayer.test.tsx | TypeScript |
ArrowFunction |
() => {
ktpMgr.delayUpdatingKeytipChange = true;
ktpMgr.inKeytipMode = true;
ktpTree.currentKeytip = ktpTree.getNode(keytipIdB);
// Add a child under B
ktpMgr.register({
content: 'X',
keySequences: ['b', 'x'],
});
jest.runAllTimers();
const visibleKeytip... | Augani/fluentui | packages/react/src/components/KeytipLayer/KeytipLayer.test.tsx | TypeScript |
ArrowFunction |
() => {
const [visible, setVisible] = useState(false);
return (
<>
<Tool>
<Button type="primary" onClick={() | foxpage/foxpage-sdk-js | packages/foxpage-debug-portal/src/App.tsx | TypeScript |
ClassDeclaration | /**
* A component that formats all the data associated with a batch for display.
*/
@Component({
selector: 'batch',
templateUrl: './batch.component.html',
styleUrls: [
'./batch.component.scss',
'../../../styles/shared/_explorer-detail.scss'
],
providers: [Base64DecodePipe]
})
export class BatchCompo... | InfoScienceLabs/IoT-chain-Explorer | src/app/batches/batch/batch.component.ts | TypeScript |
MethodDeclaration |
ngOnInit(): void {
// format data for Angular UI Ace
this.jsonData = this.formatJSONData(this.data);
} | InfoScienceLabs/IoT-chain-Explorer | src/app/batches/batch/batch.component.ts | TypeScript |
MethodDeclaration | /**
* Formats batch data into a JSON string with proper indentation for display.
* @param transactionData - data representing a transaction within the batch
* @returns {string} formatted JSON string of the data
*/
formatJSONData(data: any) {
if (!data) data = {};
// format transactions within the b... | InfoScienceLabs/IoT-chain-Explorer | src/app/batches/batch/batch.component.ts | TypeScript |
MethodDeclaration | /**
* Formats information held in the payloads in a batch's transactions.
* @param transactionData - data representing a transaction within the batch
* @returns {object} formatted transaction data
*/
formatTransactionData(transactionData: any): string {
// decode transaction's payload from base64 into J... | InfoScienceLabs/IoT-chain-Explorer | src/app/batches/batch/batch.component.ts | TypeScript |
ArrowFunction |
message => JSON.parse(message.payload.toString()) as Observation | 52North/eurofleets-dashboard | src/app/services/sta-mqtt-interface/sta-mqtt-interface.service.ts | TypeScript |
ArrowFunction |
observation => console.log(`Observation: ${observation.result}`) | 52North/eurofleets-dashboard | src/app/services/sta-mqtt-interface/sta-mqtt-interface.service.ts | TypeScript |
ClassDeclaration |
@Injectable({
providedIn: 'root'
})
export class StaMqttInterfaceService {
private mqttService: MqttService;
constructor() {
this.mqttService = new MqttService({
hostname: AppConfig.settings.sta.mqtt.hostname,
port: AppConfig.settings.sta.mqtt.port,
path: AppConfig.settings.sta.mqtt.path
... | 52North/eurofleets-dashboard | src/app/services/sta-mqtt-interface/sta-mqtt-interface.service.ts | TypeScript |
MethodDeclaration |
public subscribeDatastreamObservations(
datasetId: string,
params?: StaFilter<ObservationSelectParams, ObservationExpandParams>
): Observable<Observation> {
// TODO: add filterung: $select=result,phenomenonTime
return this.mqttService.observe(`Datastreams(${datasetId})/Observations`).pipe(
map(... | 52North/eurofleets-dashboard | src/app/services/sta-mqtt-interface/sta-mqtt-interface.service.ts | TypeScript |
MethodDeclaration |
public subscribeObservations(): Observable<Observation> {
return this.mqttService.observe(`Observations`).pipe(
map(message => JSON.parse(message.payload.toString()) as Observation),
tap(observation => console.log(`Observation: ${observation.result}`))
);
} | 52North/eurofleets-dashboard | src/app/services/sta-mqtt-interface/sta-mqtt-interface.service.ts | TypeScript |
ClassDeclaration |
export default class ChatController extends Controller {
async index() {
const { ctx } = this;
try {
const socket: any = ctx.socket;
const message = ctx.args[0] || {};
const { roomId, receive } = message;
socket.broadcast.emit(roomId, {
...message,
target: roomId
... | csjiabin/part-time-egg | app/io/controller/chat.ts | TypeScript |
MethodDeclaration |
async index() {
const { ctx } = this;
try {
const socket: any = ctx.socket;
const message = ctx.args[0] || {};
const { roomId, receive } = message;
socket.broadcast.emit(roomId, {
...message,
target: roomId
});
socket.broadcast.emit(receive, {
...mess... | csjiabin/part-time-egg | app/io/controller/chat.ts | TypeScript |
FunctionDeclaration |
function App() {
return (
<BrowserRouter>
<AuthContextProvider>
<Switch>
<Route path="/" exact component={Home} />
<Route path="/rooms/new" component={NewRoom} />
<Route path="/rooms/:id" component={Room} />
<Route path="/admin/rooms/:id" component={AdminRoo... | AloisioFernandes/NLW6-Together-React | letmeask/src/App.tsx | TypeScript |
ClassDeclaration |
@Injectable()
export class VendorBillService {
options: any;
constructor(private http: Http) {
let token = localStorage.getItem('userToken');
let headers = new Headers({ 'Content-Type': 'application/json' });
headers.append('Authorization', token)
this.options = new RequestOptions({ headers: heade... | Wahap/Supplier.PL | src/app/layout/vendorBills/vendor-bill.service.ts | TypeScript |
MethodDeclaration |
getVendorBillProducts(url: string, input: any): any {
return this.http.post(url, input, this.options)
.map((response: Response) => response.json());
} | Wahap/Supplier.PL | src/app/layout/vendorBills/vendor-bill.service.ts | TypeScript |
MethodDeclaration |
saveVendorBillPayment(url: string, input: any): any {
return this.http.post(url, input, this.options)
.map((response: Response) => response.json());
} | Wahap/Supplier.PL | src/app/layout/vendorBills/vendor-bill.service.ts | TypeScript |
MethodDeclaration |
deleteVendorBillPayment(url: string, input: any): any {
return this.http.post(url, input, this.options)
.map((response: Response) => response.json());
} | Wahap/Supplier.PL | src/app/layout/vendorBills/vendor-bill.service.ts | TypeScript |
MethodDeclaration |
saveVendorBill(url: string, input: any): any {
return this.http.post(url, input, this.options)
.map((response: Response) => response.json());
} | Wahap/Supplier.PL | src/app/layout/vendorBills/vendor-bill.service.ts | TypeScript |
MethodDeclaration |
getAllVendorBills(url: string, input: any): any {
return this.http.post(url, input, this.options)
.map((response: Response) => response.json());
} | Wahap/Supplier.PL | src/app/layout/vendorBills/vendor-bill.service.ts | TypeScript |
MethodDeclaration |
getVendorBillPayments(url: string, input: any): any {
return this.http.post(url, input, this.options)
.map((response: Response) => response.json());
} | Wahap/Supplier.PL | src/app/layout/vendorBills/vendor-bill.service.ts | TypeScript |
MethodDeclaration |
deleteVendorBill(url: string, input: any): any {
return this.http.post(url, input, this.options)
.map((response: Response) => response.json());
} | Wahap/Supplier.PL | src/app/layout/vendorBills/vendor-bill.service.ts | TypeScript |
MethodDeclaration |
filterVendorBills(url: string, input: any): any {
return this.http.post(url, input, this.options)
.map((response: Response) => response.json());
} | Wahap/Supplier.PL | src/app/layout/vendorBills/vendor-bill.service.ts | TypeScript |
MethodDeclaration |
getThisWeekVendorBills(url: string, input: any): any {
return this.http.post(url, input, this.options)
.map((response: Response) => response.json());
} | Wahap/Supplier.PL | src/app/layout/vendorBills/vendor-bill.service.ts | TypeScript |
MethodDeclaration |
getThisMonthVendorBills(url: string, input: any): any {
return this.http.post(url, input, this.options)
.map((response: Response) => response.json());
} | Wahap/Supplier.PL | src/app/layout/vendorBills/vendor-bill.service.ts | TypeScript |
ArrowFunction |
({ factory }: Pick<ts.TransformationContext, "factory">): Factory["create"] => (
params: Params,
): ts.VariableDeclaration => {
const node = factory.createVariableDeclaration(params.name, undefined, params.type, params.initializer);
return node;
} | Himenon/openapi-typescript-code-generator | src/internal/TsGenerator/factory/VariableDeclaration.ts | TypeScript |
ArrowFunction |
(
params: Params,
): ts.VariableDeclaration => {
const node = factory.createVariableDeclaration(params.name, undefined, params.type, params.initializer);
return node;
} | Himenon/openapi-typescript-code-generator | src/internal/TsGenerator/factory/VariableDeclaration.ts | TypeScript |
ArrowFunction |
(context: Pick<ts.TransformationContext, "factory">): Factory => {
return {
create: create(context),
};
} | Himenon/openapi-typescript-code-generator | src/internal/TsGenerator/factory/VariableDeclaration.ts | TypeScript |
InterfaceDeclaration |
export interface Params {
name: string | ts.BindingName;
type?: ts.TypeNode;
initializer?: ts.Expression;
} | Himenon/openapi-typescript-code-generator | src/internal/TsGenerator/factory/VariableDeclaration.ts | TypeScript |
InterfaceDeclaration |
export interface Factory {
create: (params: Params) => ts.VariableDeclaration;
} | Himenon/openapi-typescript-code-generator | src/internal/TsGenerator/factory/VariableDeclaration.ts | TypeScript |
InterfaceDeclaration |
export interface DecoratorTestStructure extends BaseTestStructure, NamedTestStructure {
isDecoratorFactory?: boolean;
arguments?: ExpressionTestStructure[];
} | 700software/ts-code-generator | src/tests/testHelpers/testStructures/general/DecoratorTestStructure.ts | TypeScript |
ArrowFunction |
(acc: { [keys: string]: Selectable<CandidateBackground_OutsideWorkExperience> }, field: Selectable<CandidateBackground_OutsideWorkExperience>) => {
acc[field._fieldName] = field;
return acc;
} | robypag/sdk-gen-sfsf | src/odata-client/sfo-data-service/CandidateBackground_OutsideWorkExperience.ts | TypeScript |
ClassDeclaration | /**
* This class represents the entity "CandidateBackground_OutsideWorkExperience" of service "SFOData".
*/
export class CandidateBackground_OutsideWorkExperience extends Entity implements CandidateBackground_OutsideWorkExperienceType {
/**
* Technical entity name for CandidateBackground_OutsideWorkExperience.
... | robypag/sdk-gen-sfsf | src/odata-client/sfo-data-service/CandidateBackground_OutsideWorkExperience.ts | TypeScript |
InterfaceDeclaration |
export interface CandidateBackground_OutsideWorkExperienceType {
backgroundElementId: BigNumber;
bgOrderPos: BigNumber;
businessType: string;
candidateId: BigNumber;
country: string;
employer: string;
endDate: Moment;
lastModifiedDateTime: Moment;
presentEmployer: string;
startDate: Moment;
start... | robypag/sdk-gen-sfsf | src/odata-client/sfo-data-service/CandidateBackground_OutsideWorkExperience.ts | TypeScript |
InterfaceDeclaration |
export interface CandidateBackground_OutsideWorkExperienceTypeForceMandatory {
backgroundElementId: BigNumber;
bgOrderPos: BigNumber;
businessType: string;
candidateId: BigNumber;
country: string;
employer: string;
endDate: Moment;
lastModifiedDateTime: Moment;
presentEmployer: string;
startDate: M... | robypag/sdk-gen-sfsf | src/odata-client/sfo-data-service/CandidateBackground_OutsideWorkExperience.ts | TypeScript |
MethodDeclaration | /**
* Returns an entity builder to construct instances `CandidateBackground_OutsideWorkExperience`.
* @returns A builder that constructs instances of entity type `CandidateBackground_OutsideWorkExperience`.
*/
static builder(): EntityBuilderType<CandidateBackground_OutsideWorkExperience, CandidateBackground_Ou... | robypag/sdk-gen-sfsf | src/odata-client/sfo-data-service/CandidateBackground_OutsideWorkExperience.ts | TypeScript |
MethodDeclaration | /**
* Returns a request builder to construct requests for operations on the `CandidateBackground_OutsideWorkExperience` entity type.
* @returns A `CandidateBackground_OutsideWorkExperience` request builder.
*/
static requestBuilder(): CandidateBackground_OutsideWorkExperienceRequestBuilder {
return new Can... | robypag/sdk-gen-sfsf | src/odata-client/sfo-data-service/CandidateBackground_OutsideWorkExperience.ts | TypeScript |
MethodDeclaration | /**
* Returns a selectable object that allows the selection of custom field in a get request for the entity `CandidateBackground_OutsideWorkExperience`.
* @param fieldName Name of the custom field to select
* @returns A builder that constructs instances of entity type `CandidateBackground_OutsideWorkExperience... | robypag/sdk-gen-sfsf | src/odata-client/sfo-data-service/CandidateBackground_OutsideWorkExperience.ts | TypeScript |
MethodDeclaration | /**
* Overwrites the default toJSON method so that all instance variables as well as all custom fields of the entity are returned.
* @returns An object containing all instance variables + custom fields.
*/
toJSON(): { [key: string]: any } {
return { ...this, ...this._customFields };
} | robypag/sdk-gen-sfsf | src/odata-client/sfo-data-service/CandidateBackground_OutsideWorkExperience.ts | TypeScript |
ClassDeclaration |
@Module({
controllers: [MemesController],
providers: [MemesService],
imports: [ConfigModule],
})
export class MemesModule {} | kamilwronka/memes-service | src/memes/memes.module.ts | TypeScript |
FunctionDeclaration |
function triggerAbortedSignalAfterNumCalls(maxCalls: number): AbortSignal {
let count = 0;
const abortSignal: AbortSignal = {
get aborted(): boolean {
++count;
if (count >= maxCalls) {
return true;
}
return false;
},
addEventListener: () => {},
removeEventListener... | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
ArrowFunction |
async () => {
let checkpoints: Checkpoint[] = [
{
fullyQualifiedNamespace: "not-used-for-this-test",
consumerGroup: "not-used-for-this-test",
eventHubName: "not-used-for-this-test",
offset: 1009,
sequenceNumber: 1010,
partitionId: "0"
},... | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
ArrowFunction |
async () => {
return [];
} | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
ArrowFunction |
async () => {
return checkpoints;
} | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
ArrowFunction |
() => {
let eventProcessor: EventProcessor;
let userCallback: (() => void) | undefined;
let errorFromCallback: Error | undefined;
let contextFromCallback: PartitionContext | undefined;
beforeEach(() => {
userCallback = undefined;
errorFromCallback = undefined;
con... | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
ArrowFunction |
() => {
userCallback = undefined;
errorFromCallback = undefined;
contextFromCallback = undefined;
// note: we're not starting this event processor so there's nothing to stop()
// it's only here so we can call a few private methods on it.
eventProcessor = new EventProces... | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
ArrowFunction |
async (err, context) => {
// simulate the user messing up and accidentally throwing an error
// we should just log it and not kill anything.
errorFromCallback = err;
contextFromCallback = context;
if (userCallback) {
userCallback();... | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
ArrowFunction |
async () => {
// the user's error handler will throw an error - won't escape from this function
userCallback = () => {
throw new Error("Error thrown from the user's error handler");
};
await eventProcessor["_handleSubscriptionError"](new Error("test error"));
errorFr... | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
ArrowFunction |
() => {
throw new Error("Error thrown from the user's error handler");
} | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
ArrowFunction |
async () => {
// the user's error handler will throw an error - won't escape from this function
await eventProcessor["_handleSubscriptionError"](new AbortError("test error"));
// we don't call the user's handler for abort errors
should.not.exist(errorFromCallback);
should.not.... | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
ArrowFunction |
async () => {
const checkpointStore = {
claimOwnershipCalled: false,
// the important thing is that the EventProcessor won't be able to claim
// any partitions, causing it to go down the "I tried but failed" path.
async claimOwnership(_: PartitionOwnership[]): Promise<PartitionOw... | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
ArrowFunction |
async () => {
const commonFields = {
fullyQualifiedNamespace: "irrelevant namespace",
eventHubName: "irrelevant eventhub name",
consumerGroup: "irrelevant consumer group"
};
const handlers = new FakeSubscriptionEventHandlers();
const checkpointStore = new InMemoryCheckp... | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
ArrowFunction |
(a, b) => a.partitionId.localeCompare(b.partitionId) | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
ArrowFunction |
() => commonFields.eventHubName | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
ArrowFunction |
() => commonFields.fullyQualifiedNamespace | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
ArrowFunction |
async () => {
const errors = [];
const faultyCheckpointStore: CheckpointStore = {
listOwnership: async () => [],
claimOwnership: async () => {
throw new Error("Some random failure!");
},
updateCheckpoint: async () => {},
listCheckpoints: async () => []
};
const e... | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
ArrowFunction |
async () => [] | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
ArrowFunction |
async () => {
throw new Error("Some random failure!");
} | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
ArrowFunction |
async (err, _) => {
errors.push(err);
} | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
ArrowFunction |
async () => errors.length !== 0 | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
ArrowFunction |
async () => {
const errors = new Set<Error>();
const eventProcessor = new EventProcessor(
EventHubClient.defaultConsumerGroupName,
client,
{
processClose: async () => {
throw new Error("processClose() error");
},
processEvents: async () => {
throw ... | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
ArrowFunction |
async () => {
throw new Error("processClose() error");
} | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
ArrowFunction |
async () => {
throw new Error("processEvents() error");
} | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
ArrowFunction |
async () => {
throw new Error("processInitialize() error");
} | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
ArrowFunction |
async (err, _) => {
errors.add(err);
throw new Error("These are logged but ignored");
} | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
ArrowFunction |
async () => errors.size >= 3 | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
ArrowFunction |
(e) => e.message | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
ArrowFunction |
async (context) => context.setStartingPosition(EventPosition.latest()) | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
ArrowFunction |
async (context) => {
didPartitionProcessorStart = true;
context.setStartingPosition(EventPosition.latest());
} | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
ArrowFunction |
async (event, context) => {} | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
ArrowFunction |
(id) => checkpointMap.set(id, []) | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
ArrowFunction |
async () => {
const checkpointStore = new InMemoryCheckpointStore();
const allObjects = new Set();
const assertUnique = (...objects: any[]) => {
const size = allObjects.size;
for (const obj of objects) {
allObjects.add(obj);
size.should.be.lessThan(allObjects.siz... | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
ArrowFunction |
(...objects: any[]) => {
const size = allObjects.size;
for (const obj of objects) {
allObjects.add(obj);
size.should.be.lessThan(allObjects.size);
}
} | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
ArrowFunction |
(id) => partitionResultsMap.set(id, { events: [], initialized: false }) | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
ArrowFunction |
(event) => event.body | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
ArrowFunction |
async () => partitionOwnershipArr.size === partitionIds.length | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
ArrowFunction |
async () => {
// Ensure the partition ownerships are balanced.
const eventProcessorIds = Object.keys(claimedPartitionsMap);
// There are 2 processors, so we should see 2 entries.
if (eventProcessorIds.length !== 2) {
return false;
}
... | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
ArrowFunction |
async () => thrashAfterSettling | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
ClassDeclaration |
class FooPartitionProcessor {
async processInitialize(context: InitializationContext) {
context.setStartingPosition(EventPosition.earliest());
}
async processEvents(events: ReceivedEventData[], context: PartitionContext) {
processedAtLeastOneEvent.add(context.partitionId);
... | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
ClassDeclaration | // The partitionProcess will need to add events to the partitionResultsMap as they are received
class FooPartitionProcessor implements Required<SubscriptionEventHandlers> {
async processInitialize(context: InitializationContext) {
loggerForTest(`processInitialize(${context.partitionId})`);
p... | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
ClassDeclaration | // The partitionProcess will need to add events to the partitionResultsMap as they are received
class FooPartitionProcessor {
async processInitialization(context: InitializationContext) {
context.setStartingPosition(EventPosition.earliest());
}
async processEvents(events: ReceivedEvent... | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
ClassDeclaration |
class SimpleEventProcessor implements SubscriptionEventHandlers {
async processInitialization(context: InitializationContext) {
context.setStartingPosition(EventPosition.latest());
}
async processEvents(events: ReceivedEventData[], context: PartitionContext) {
partitionIdsSe... | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
MethodDeclaration | // the important thing is that the EventProcessor won't be able to claim
// any partitions, causing it to go down the "I tried but failed" path.
async claimOwnership(_: PartitionOwnership[]): Promise<PartitionOwnership[]> {
checkpointStore.claimOwnershipCalled = true;
return [];
} | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
MethodDeclaration | // (these aren't used for this test)
async listOwnership(): Promise<PartitionOwnership[]> {
return [];
} | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
MethodDeclaration |
async updateCheckpoint(): Promise<void> {} | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
MethodDeclaration |
async listCheckpoints(): Promise<Checkpoint[]> {
return [];
} | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
MethodDeclaration |
async createPump() {
pumpManager.createPumpCalled = true;
} | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
MethodDeclaration |
async removeAllPumps() {} | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
MethodDeclaration |
async createPump() {} | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
MethodDeclaration |
async removeAllPumps(): Promise<void> {} | qiaozha/azure-sdk-for-js | sdk/eventhub/event-hubs/test/eventProcessor.spec.ts | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.