type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
FunctionDeclaration
export async function main(argv: NativeParsedArgs): Promise<void> { const services = new ServiceCollection(); const disposables = new DisposableStore(); const environmentService = new NativeEnvironmentService(argv); const logService: ILogService = new SpdLogService('cli', environmentService.logsPath, getLogLevel(...
jepetty/vscode
src/vs/code/node/cliProcessMain.ts
TypeScript
ArrowFunction
(id: string) => localize('notFound', "Extension '{0}' not found.", id)
jepetty/vscode
src/vs/code/node/cliProcessMain.ts
TypeScript
ArrowFunction
(id: string) => localize('notInstalled', "Extension '{0}' is not installed.", id)
jepetty/vscode
src/vs/code/node/cliProcessMain.ts
TypeScript
ArrowFunction
c => c.toLowerCase()
jepetty/vscode
src/vs/code/node/cliProcessMain.ts
TypeScript
ArrowFunction
e => { if (e.manifest.categories) { const lowerCaseCategories: string[] = e.manifest.categories.map(c => c.toLowerCase()); return lowerCaseCategories.indexOf(category.toLowerCase()) > -1; } return false; }
jepetty/vscode
src/vs/code/node/cliProcessMain.ts
TypeScript
ArrowFunction
category => { console.log(category); }
jepetty/vscode
src/vs/code/node/cliProcessMain.ts
TypeScript
ArrowFunction
e => console.log(getId(e.manifest, showVersions))
jepetty/vscode
src/vs/code/node/cliProcessMain.ts
TypeScript
ArrowFunction
async vsix => { try { const manifest = await this.installVSIX(vsix, force); if (manifest) { installedExtensionsManifests.push(manifest); } } catch (err) { console.error(err.message || err.stack || err); failed.push(vsix); } }
jepetty/vscode
src/vs/code/node/cliProcessMain.ts
TypeScript
ArrowFunction
async extensionInfo => { const gallery = galleryExtensions.get(extensionInfo.id.toLowerCase()); if (gallery) { try { const manifest = await this.installFromGallery(extensionInfo, gallery, installed, force); if (manifest) { installedExtensionsManifests.push(manifest); } } catc...
jepetty/vscode
src/vs/code/node/cliProcessMain.ts
TypeScript
ArrowFunction
manifest => isLanguagePackExtension(manifest)
jepetty/vscode
src/vs/code/node/cliProcessMain.ts
TypeScript
ArrowFunction
({ version }) => version === undefined
jepetty/vscode
src/vs/code/node/cliProcessMain.ts
TypeScript
ArrowFunction
({ version }) => version !== undefined
jepetty/vscode
src/vs/code/node/cliProcessMain.ts
TypeScript
ArrowFunction
async () => { const result = await this.extensionGalleryService.getExtensions(extensionIds, CancellationToken.None); result.forEach(extension => galleryExtensions.set(extension.identifier.id.toLowerCase(), extension)); }
jepetty/vscode
src/vs/code/node/cliProcessMain.ts
TypeScript
ArrowFunction
extension => galleryExtensions.set(extension.identifier.id.toLowerCase(), extension)
jepetty/vscode
src/vs/code/node/cliProcessMain.ts
TypeScript
ArrowFunction
async ({ id, version }) => { const extension = await this.extensionGalleryService.getCompatibleExtension({ id }, version); if (extension) { galleryExtensions.set(extension.identifier.id.toLowerCase(), extension); } }
jepetty/vscode
src/vs/code/node/cliProcessMain.ts
TypeScript
ArrowFunction
e => areSameExtensions(e.identifier, galleryExtension.identifier)
jepetty/vscode
src/vs/code/node/cliProcessMain.ts
TypeScript
ArrowFunction
local => areSameExtensions(extensionIdentifier, local.identifier) && semver.gt(local.manifest.version, manifest.version)
jepetty/vscode
src/vs/code/node/cliProcessMain.ts
TypeScript
ArrowFunction
e => areSameExtensions(e.identifier, { id })
jepetty/vscode
src/vs/code/node/cliProcessMain.ts
TypeScript
ArrowFunction
e => isLanguagePackExtension(e.manifest)
jepetty/vscode
src/vs/code/node/cliProcessMain.ts
TypeScript
ArrowFunction
e => { installed.forEach(i => { if (i.identifier.id === e) { if (i.location.scheme === Schemas.file) { console.log(i.location.fsPath); return; } } }); }
jepetty/vscode
src/vs/code/node/cliProcessMain.ts
TypeScript
ArrowFunction
i => { if (i.identifier.id === e) { if (i.location.scheme === Schemas.file) { console.log(i.location.fsPath); return; } } }
jepetty/vscode
src/vs/code/node/cliProcessMain.ts
TypeScript
ArrowFunction
() => logService.dispose()
jepetty/vscode
src/vs/code/node/cliProcessMain.ts
TypeScript
ArrowFunction
(path): undefined | Promise<void> => path ? mkdirp(path) : undefined
jepetty/vscode
src/vs/code/node/cliProcessMain.ts
TypeScript
ArrowFunction
async accessor => { const stateService = accessor.get(IStateService); const { appRoot, extensionsPath, extensionDevelopmentLocationURI, isBuilt, installSourcePath } = environmentService; const services = new ServiceCollection(); services.set(IRequestService, new SyncDescriptor(RequestService)); services.se...
jepetty/vscode
src/vs/code/node/cliProcessMain.ts
TypeScript
TypeAliasDeclaration
type InstallExtensionInfo = { id: string, version?: string, installOptions: InstallOptions };
jepetty/vscode
src/vs/code/node/cliProcessMain.ts
TypeScript
MethodDeclaration
async run(argv: NativeParsedArgs): Promise<void> { if (argv['install-source']) { await this.setInstallSource(argv['install-source']); } else if (argv['list-extensions']) { await this.listExtensions(!!argv['show-versions'], argv['category']); } else if (argv['install-extension'] || argv['install-builtin-ext...
jepetty/vscode
src/vs/code/node/cliProcessMain.ts
TypeScript
MethodDeclaration
private setInstallSource(installSource: string): Promise<void> { return writeFile(this.environmentService.installSourcePath, installSource.slice(0, 30)); }
jepetty/vscode
src/vs/code/node/cliProcessMain.ts
TypeScript
MethodDeclaration
private async listExtensions(showVersions: boolean, category?: string): Promise<void> { let extensions = await this.extensionManagementService.getInstalled(ExtensionType.User); const categories = EXTENSION_CATEGORIES.map(c => c.toLowerCase()); if (category && category !== '') { if (categories.indexOf(category...
jepetty/vscode
src/vs/code/node/cliProcessMain.ts
TypeScript
MethodDeclaration
private async installExtensions(extensions: string[], builtinExtensionIds: string[], isMachineScoped: boolean, force: boolean): Promise<void> { const failed: string[] = []; const installedExtensionsManifests: IExtensionManifest[] = []; if (extensions.length) { console.log(localize('installingExtensions', "Ins...
jepetty/vscode
src/vs/code/node/cliProcessMain.ts
TypeScript
MethodDeclaration
private async installVSIX(vsix: string, force: boolean): Promise<IExtensionManifest | null> { vsix = path.isAbsolute(vsix) ? vsix : path.join(process.cwd(), vsix); const manifest = await getManifest(vsix); const valid = await this.validate(manifest, force); if (valid) { try { await this.extensionManagem...
jepetty/vscode
src/vs/code/node/cliProcessMain.ts
TypeScript
MethodDeclaration
private async getGalleryExtensions(extensions: InstallExtensionInfo[]): Promise<Map<string, IGalleryExtension>> { const extensionIds = extensions.filter(({ version }) => version === undefined).map(({ id }) => id); const extensionsWithIdAndVersion = extensions.filter(({ version }) => version !== undefined); cons...
jepetty/vscode
src/vs/code/node/cliProcessMain.ts
TypeScript
MethodDeclaration
private async installFromGallery({ id, version, installOptions }: InstallExtensionInfo, galleryExtension: IGalleryExtension, installed: ILocalExtension[], force: boolean): Promise<IExtensionManifest | null> { const manifest = await this.extensionGalleryService.getManifest(galleryExtension, CancellationToken.None); ...
jepetty/vscode
src/vs/code/node/cliProcessMain.ts
TypeScript
MethodDeclaration
private async validate(manifest: IExtensionManifest, force: boolean): Promise<boolean> { if (!manifest) { throw new Error('Invalid vsix'); } const extensionIdentifier = { id: getGalleryExtensionId(manifest.publisher, manifest.name) }; const installedExtensions = await this.extensionManagementService.getIns...
jepetty/vscode
src/vs/code/node/cliProcessMain.ts
TypeScript
MethodDeclaration
private async uninstallExtension(extensions: string[], force: boolean): Promise<void> { async function getExtensionId(extensionDescription: string): Promise<string> { if (!/\.vsix$/i.test(extensionDescription)) { return extensionDescription; } const zipPath = path.isAbsolute(extensionDescription) ? ext...
jepetty/vscode
src/vs/code/node/cliProcessMain.ts
TypeScript
MethodDeclaration
private async locateExtension(extensions: string[]): Promise<void> { const installed = await this.extensionManagementService.getInstalled(); extensions.forEach(e => { installed.forEach(i => { if (i.identifier.id === e) { if (i.location.scheme === Schemas.file) { console.log(i.location.fsPath); ...
jepetty/vscode
src/vs/code/node/cliProcessMain.ts
TypeScript
MethodDeclaration
private async updateLocalizationsCache(): Promise<void> { const localizationService = this.instantiationService.createInstance(LocalizationsService); await localizationService.update(); localizationService.dispose(); }
jepetty/vscode
src/vs/code/node/cliProcessMain.ts
TypeScript
FunctionDeclaration
export function GroupBox({ children }: GroupBoxProps): JSX.Element { return ( <Box bg="background.800" p="5" borderRadius="4px" minWidth="280px"> {children} </Box> ) }
interep-project/reputation-service
src/components/group-box/group-box.tsx
TypeScript
TypeAliasDeclaration
export type GroupBoxProps = { children: JSX.Element[] }
interep-project/reputation-service
src/components/group-box/group-box.tsx
TypeScript
ArrowFunction
(newVersion: RuntimeExtensionMajorVersions, oldVersion: RuntimeExtensionMajorVersions | null) => { if (oldVersion === RuntimeExtensionMajorVersions.custom || newVersion === RuntimeExtensionMajorVersions.custom) { // If the user is setting a customer version, we assume they know what they're doing. return tru...
fashaikh/azure-functions-ux
client-react/src/pages/app/app-settings/FunctionRuntimeSettings/RuntimeVersion.tsx
TypeScript
ArrowFunction
(): string => { if (waitingOnFunctionsApi && !hasCustomRuntimeVersion) { return t('loading'); } if (failedToGetFunctions) { return t('loadingFailed'); } return ''; }
fashaikh/azure-functions-ux
client-react/src/pages/app/app-settings/FunctionRuntimeSettings/RuntimeVersion.tsx
TypeScript
ArrowFunction
() => { let runtimeVersionInUse: RuntimeExtensionMajorVersions | null = null; if ( asyncData.functionsHostStatus.loadingState === LoadingStates.complete && asyncData.functionsHostStatus.value && asyncData.functionsHostStatus.value.properties.state !== HostStates.error ) { // Try to...
fashaikh/azure-functions-ux
client-react/src/pages/app/app-settings/FunctionRuntimeSettings/RuntimeVersion.tsx
TypeScript
ArrowFunction
() => { return initialRuntimeMajorVersion !== RuntimeExtensionMajorVersions.v2; }
fashaikh/azure-functions-ux
client-react/src/pages/app/app-settings/FunctionRuntimeSettings/RuntimeVersion.tsx
TypeScript
ArrowFunction
(): IDropdownOption[] => { if (hasCustomRuntimeVersion) { // NOTE(shimedh): When we move to using stacks API, this should be driven by the versions supported by a particular stack. if (shouldEnableForV4) { return [ { key: RuntimeExtensionMajorVersions.v3, text:...
fashaikh/azure-functions-ux
client-react/src/pages/app/app-settings/FunctionRuntimeSettings/RuntimeVersion.tsx
TypeScript
ArrowFunction
(): boolean => waitingOnFunctionsApi || failedToGetFunctions || (hasCustomRuntimeVersion && !shouldEnableForV4)
fashaikh/azure-functions-ux
client-react/src/pages/app/app-settings/FunctionRuntimeSettings/RuntimeVersion.tsx
TypeScript
ArrowFunction
version => { switch (version) { case RuntimeExtensionMajorVersions.v2: return CommonConstants.NodeVersions.v2; case RuntimeExtensionMajorVersions.v3: return CommonConstants.NodeVersions.v3; default: return CommonConstants.NodeVersions.default; } }
fashaikh/azure-functions-ux
client-react/src/pages/app/app-settings/FunctionRuntimeSettings/RuntimeVersion.tsx
TypeScript
ArrowFunction
(newVersion: RuntimeExtensionMajorVersions) => hasFunctions && !isVersionChangeSafe(newVersion, getRuntimeVersionInUse())
fashaikh/azure-functions-ux
client-react/src/pages/app/app-settings/FunctionRuntimeSettings/RuntimeVersion.tsx
TypeScript
ArrowFunction
(newVersion: RuntimeExtensionMajorVersions) => { setMovingFromV2Warning(undefined); if (isExistingFunctionsWarningNeeded(newVersion)) { setPendingVersion(newVersion); } else { if (newVersion === RuntimeExtensionMajorVersions.v3 && initialRuntimeMajorVersion === RuntimeExtensionMajorVersions.v2)...
fashaikh/azure-functions-ux
client-react/src/pages/app/app-settings/FunctionRuntimeSettings/RuntimeVersion.tsx
TypeScript
ArrowFunction
() => { updateDropDownValue(pendingVersion!); setPendingVersion(undefined); }
fashaikh/azure-functions-ux
client-react/src/pages/app/app-settings/FunctionRuntimeSettings/RuntimeVersion.tsx
TypeScript
ArrowFunction
() => { setPendingVersion(undefined); }
fashaikh/azure-functions-ux
client-react/src/pages/app/app-settings/FunctionRuntimeSettings/RuntimeVersion.tsx
TypeScript
ArrowFunction
(newVersion: RuntimeExtensionMajorVersions) => { let appSettings: FormAppSetting[] = [...values.appSettings]; // Remove AZUREJOBS_EXTENSION_VERSION app setting (if present) appSettings = removeFromAppSetting(values.appSettings, CommonConstants.AppSettingNames.azureJobsExtensionVersion); if (newVersio...
fashaikh/azure-functions-ux
client-react/src/pages/app/app-settings/FunctionRuntimeSettings/RuntimeVersion.tsx
TypeScript
ArrowFunction
() => { setMovingFromV2Warning(undefined); // eslint-disable-next-line react-hooks/exhaustive-deps }
fashaikh/azure-functions-ux
client-react/src/pages/app/app-settings/FunctionRuntimeSettings/RuntimeVersion.tsx
TypeScript
MethodDeclaration
t('functionsRuntimeVersionExistingFunctionsConfirmationTitle')
fashaikh/azure-functions-ux
client-react/src/pages/app/app-settings/FunctionRuntimeSettings/RuntimeVersion.tsx
TypeScript
MethodDeclaration
t('functionsRuntimeVersionExistingFunctionsConfirmationMessage')
fashaikh/azure-functions-ux
client-react/src/pages/app/app-settings/FunctionRuntimeSettings/RuntimeVersion.tsx
TypeScript
MethodDeclaration
getOptions()
fashaikh/azure-functions-ux
client-react/src/pages/app/app-settings/FunctionRuntimeSettings/RuntimeVersion.tsx
TypeScript
MethodDeclaration
t('runtimeVersion')
fashaikh/azure-functions-ux
client-react/src/pages/app/app-settings/FunctionRuntimeSettings/RuntimeVersion.tsx
TypeScript
ArrowFunction
async (resolve,reject) => { let realFile = path.resolve(this.file) if (await Utils.fs.exists(realFile) || this.buffer != null) { try { let image = null; if (this.buffer != null) { image = sharp(this.buffer,{ density: 500 }); } else { image = ...
moimart/icon-tool-mac
lib/IconCreatorSharp.ts
TypeScript
ArrowFunction
err => reject(err)
moimart/icon-tool-mac
lib/IconCreatorSharp.ts
TypeScript
ClassDeclaration
export class IconCreatorSharp extends IconCreator { private useBuffer: boolean = false; private buffers: Map<string,Buffer> = new Map<string,Buffer>(); private output?: string; private manipulation: ManipulationCallback = null; constructor(file: string | Buffer, output?: string) { super(file,output); ...
moimart/icon-tool-mac
lib/IconCreatorSharp.ts
TypeScript
TypeAliasDeclaration
export type ManipulationCallback = (image:sharp.SharpInstance,size?:number) => void;
moimart/icon-tool-mac
lib/IconCreatorSharp.ts
TypeScript
MethodDeclaration
public setImageManipulation(callback:ManipulationCallback) { this.manipulation = callback; }
moimart/icon-tool-mac
lib/IconCreatorSharp.ts
TypeScript
MethodDeclaration
public convert(): Promise<string | Buffer> { return new Promise<string>(async (resolve,reject) => { let realFile = path.resolve(this.file) if (await Utils.fs.exists(realFile) || this.buffer != null) { try { let image = null; if (this.buffer != null) { image = ...
moimart/icon-tool-mac
lib/IconCreatorSharp.ts
TypeScript
MethodDeclaration
private async createIcns(resolve, reject) { let writer = new IconWriterNative(this.buffers,this.output); const res = await writer.write().catch(error => reject(error)); if (res instanceof Buffer) { resolve(res); } else { resolve(this.output); } }
moimart/icon-tool-mac
lib/IconCreatorSharp.ts
TypeScript
MethodDeclaration
private swapChannels(data:Buffer): Buffer { for (let i = 0; i < data.length; i += 4) { let tmp0 = data[i]; let tmp1 = data[i+1]; let tmp2 = data[i+2]; let tmp3 = data[i+3]; data[i] = tmp3; //A data[i+1] = tmp0; //R data[i+2] = tmp1; //G data[i+3] = tmp2; //B } ...
moimart/icon-tool-mac
lib/IconCreatorSharp.ts
TypeScript
MethodDeclaration
private async createBuffers(image:sharp.SharpInstance) { for (let desc of IconDescriptor.createDescriptors()) { let scaledImage = image.clone().resize(desc.size,desc.size); if (this.manipulation !== null) { this.manipulation(scaledImage,desc.size); } if (desc.tag == "16x16" || desc...
moimart/icon-tool-mac
lib/IconCreatorSharp.ts
TypeScript
ArrowFunction
() => { let component: MyDashboardComponent; let fixture: ComponentFixture<MyDashboardComponent>; beforeEach(async () => { await TestBed.configureTestingModule({ declarations: [MyDashboardComponent], }).compileComponents(); }); beforeEach(() => { fixture = TestBed.createComponent(MyDashbo...
SvilenYanovskiFT/Quizzly
src/main/webapp/app/home/my-dashboard/my-dashboard.component.spec.ts
TypeScript
ArrowFunction
async () => { await TestBed.configureTestingModule({ declarations: [MyDashboardComponent], }).compileComponents(); }
SvilenYanovskiFT/Quizzly
src/main/webapp/app/home/my-dashboard/my-dashboard.component.spec.ts
TypeScript
ArrowFunction
() => { fixture = TestBed.createComponent(MyDashboardComponent); component = fixture.componentInstance; fixture.detectChanges(); }
SvilenYanovskiFT/Quizzly
src/main/webapp/app/home/my-dashboard/my-dashboard.component.spec.ts
TypeScript
ArrowFunction
(value: any) => { if (!value) { return value; } let isArray = Array.isArray(value); const shouldBeArray = value instanceof Array === false && isArray; if (shouldBeArray) { value = Array.from(value as any); isArray = true; } if (typeof value === "object" || isArray) {...
Ayush0017/webiny-js
packages/api-headless-cms-ddb/src/dynamoDb/storage/richText.ts
TypeScript
ArrowFunction
async ({ field, value: storageValue }) => { if (!storageValue) { return storageValue; } else if (typeof storageValue !== "object") { throw new WebinyError( `RichText value received in "fromStorage" function is not an object in field "${field.fieldId}".` ...
Ayush0017/webiny-js
packages/api-headless-cms-ddb/src/dynamoDb/storage/richText.ts
TypeScript
ArrowFunction
async ({ value }) => { /** * There is a possibility that we are trying to compress already compressed value. * Introduced a bug with 5.8.0 storage operations, so just return the value to correct it. */ if (value && value.hasOwnProperty("compression") === true) { r...
Ayush0017/webiny-js
packages/api-headless-cms-ddb/src/dynamoDb/storage/richText.ts
TypeScript
ArrowFunction
() => { return plugin; }
Ayush0017/webiny-js
packages/api-headless-cms-ddb/src/dynamoDb/storage/richText.ts
TypeScript
ArrowFunction
({ className }: any) => ( <div className={className}> <p> <strong> Terms &amp
carver/dx-react
src/components/Terms/index.tsx
TypeScript
ArrowFunction
({ className }: any) => ( <div className={className}> <p> <strong> Terms &amp
carver/dx-react
src/components/Terms/index.tsx
TypeScript
ArrowFunction
(props: any) => <div className
carver/dx-react
src/components/Terms/index.tsx
TypeScript
InterfaceDeclaration
interface on
carver/dx-react
src/components/Terms/index.tsx
TypeScript
InterfaceDeclaration
interface to
carver/dx-react
src/components/Terms/index.tsx
TypeScript
InterfaceDeclaration
interface is
carver/dx-react
src/components/Terms/index.tsx
TypeScript
InterfaceDeclaration
interface must
carver/dx-react
src/components/Terms/index.tsx
TypeScript
InterfaceDeclaration
interface other
carver/dx-react
src/components/Terms/index.tsx
TypeScript
FunctionDeclaration
export function HistoryControllerTest() { describe('HistoryController', () => { let historyController: HistoryController; let env: Mock.IMockEnvironment; beforeEach(() => { env = new Mock.MockEnvironmentBuilder().withLiveQueryStateModel().build(); historyController = new HistoryController(en...
ThibodeauJF/search-ui
unitTests/controllers/HistoryControllerTest.ts
TypeScript
ArrowFunction
() => { let historyController: HistoryController; let env: Mock.IMockEnvironment; beforeEach(() => { env = new Mock.MockEnvironmentBuilder().withLiveQueryStateModel().build(); historyController = new HistoryController(env.root, Mock.mockWindow(), env.queryStateModel, env.queryController, env.u...
ThibodeauJF/search-ui
unitTests/controllers/HistoryControllerTest.ts
TypeScript
ArrowFunction
() => { env = new Mock.MockEnvironmentBuilder().withLiveQueryStateModel().build(); historyController = new HistoryController(env.root, Mock.mockWindow(), env.queryStateModel, env.queryController, env.usageAnalytics); }
ThibodeauJF/search-ui
unitTests/controllers/HistoryControllerTest.ts
TypeScript
ArrowFunction
() => { historyController = null; env = null; }
ThibodeauJF/search-ui
unitTests/controllers/HistoryControllerTest.ts
TypeScript
ArrowFunction
() => { env.queryStateModel.attributes = { a: 'a', b: 'b', c: 'notDefault', d: [1, 2, 3] }; env.queryStateModel.defaultAttributes = { a: 'a', b: 'b', c: 'c', d: [2, 3, 4] }; $$(historyController.element).trigger('state:all'...
ThibodeauJF/search-ui
unitTests/controllers/HistoryControllerTest.ts
TypeScript
ArrowFunction
() => { expect(historyController.window.addEventListener).toHaveBeenCalledWith('hashchange', jasmine.any(Function)); }
ThibodeauJF/search-ui
unitTests/controllers/HistoryControllerTest.ts
TypeScript
ArrowFunction
() => { historyController = new HistoryController(env.root, Mock.mockWindow(), env.queryStateModel, env.queryController); historyController.setHashValues({ q: 'test' }); expect(historyController.handleHashChange.bind(historyController)).not.toThrow(); }
ThibodeauJF/search-ui
unitTests/controllers/HistoryControllerTest.ts
TypeScript
ArrowFunction
() => { $$(historyController.element).trigger(InitializationEvents.restoreHistoryState); expect(historyController.window.location.replace).not.toHaveBeenCalled(); }
ThibodeauJF/search-ui
unitTests/controllers/HistoryControllerTest.ts
TypeScript
ArrowFunction
() => { historyController = new HistoryController(env.root, Mock.mockWindow(), env.queryStateModel, env.queryController); spyOn(env.queryStateModel, 'setMultiple'); historyController.replaceState({ q: 'bar' }); expect(env.queryStateModel.setMultiple).not.toHaveBeenCalled(); }
ThibodeauJF/search-ui
unitTests/controllers/HistoryControllerTest.ts
TypeScript
ArrowFunction
() => { let fakeHashUtils; beforeEach(() => { fakeHashUtils = {} as any; fakeHashUtils.getValue = jasmine.createSpy('getValue'); fakeHashUtils.getHash = jasmine.createSpy('getHash').and.callFake(() => Mock.mockWindow().location.hash); fakeHashUtils.encodeValues = jasmine.cre...
ThibodeauJF/search-ui
unitTests/controllers/HistoryControllerTest.ts
TypeScript
ArrowFunction
() => { fakeHashUtils = {} as any; fakeHashUtils.getValue = jasmine.createSpy('getValue'); fakeHashUtils.getHash = jasmine.createSpy('getHash').and.callFake(() => Mock.mockWindow().location.hash); fakeHashUtils.encodeValues = jasmine.createSpy('encodeValues'); historyController....
ThibodeauJF/search-ui
unitTests/controllers/HistoryControllerTest.ts
TypeScript
ArrowFunction
() => Mock.mockWindow().location.hash
ThibodeauJF/search-ui
unitTests/controllers/HistoryControllerTest.ts
TypeScript
ArrowFunction
() => { let threwError = false; env.queryStateModel.attributes = { a: 1, b: 2, c: 3 }; const throwsAnError = () => { if (!threwError) { threwError = true; throw new Error(); } }; historyControlle...
ThibodeauJF/search-ui
unitTests/controllers/HistoryControllerTest.ts
TypeScript
ArrowFunction
() => { if (!threwError) { threwError = true; throw new Error(); } }
ThibodeauJF/search-ui
unitTests/controllers/HistoryControllerTest.ts
TypeScript
ArrowFunction
() => { beforeEach(() => { historyController = new HistoryController(env.root, window, env.queryStateModel, env.queryController, env.usageAnalytics); historyController.hashUtils = fakeHashUtils; $$(historyController.element).trigger(InitializationEvents.restoreHistoryState); ...
ThibodeauJF/search-ui
unitTests/controllers/HistoryControllerTest.ts
TypeScript
ArrowFunction
() => { historyController = new HistoryController(env.root, window, env.queryStateModel, env.queryController, env.usageAnalytics); historyController.hashUtils = fakeHashUtils; $$(historyController.element).trigger(InitializationEvents.restoreHistoryState); }
ThibodeauJF/search-ui
unitTests/controllers/HistoryControllerTest.ts
TypeScript
ArrowFunction
() => { window.location.hash = ''; }
ThibodeauJF/search-ui
unitTests/controllers/HistoryControllerTest.ts
TypeScript
ArrowFunction
(key, value) => { historyController.hashUtils.getValue = jasmine.createSpy('getValue').and.callFake((valueNeeded: string) => { if (valueNeeded == key) { return value; } return undefined; }); }
ThibodeauJF/search-ui
unitTests/controllers/HistoryControllerTest.ts
TypeScript
ArrowFunction
(valueNeeded: string) => { if (valueNeeded == key) { return value; } return undefined; }
ThibodeauJF/search-ui
unitTests/controllers/HistoryControllerTest.ts
TypeScript
ArrowFunction
(cause: IAnalyticsActionCause) => { expect(historyController.usageAnalytics.logSearchEvent).toHaveBeenCalledWith(cause, { facetId: '@foo', facetField: '@foo', facetTitle: '@foo', facetValue: 'bar' } as IAnalyticsFacetMeta); }
ThibodeauJF/search-ui
unitTests/controllers/HistoryControllerTest.ts
TypeScript
ArrowFunction
() => { simulateHashModule('q', 'foo'); window.dispatchEvent(new Event('hashchange')); expect(historyController.usageAnalytics.logSearchEvent).toHaveBeenCalledWith(analyticsActionCauseList.searchboxSubmit, {}); }
ThibodeauJF/search-ui
unitTests/controllers/HistoryControllerTest.ts
TypeScript