type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
TypeAliasDeclaration
export type TGetPlotsBroadCast = { plots: Plot[]; failed_to_open_filenames: string[]; not_found_filenames: string[]; };
1Megu/chia-agent
src/api/ws/harvester/index.ts
TypeScript
TypeAliasDeclaration
// Whole commands for the service export type chia_harvester_commands = get_plots_command;
1Megu/chia-agent
src/api/ws/harvester/index.ts
TypeScript
TypeAliasDeclaration
export type TChiaHarvesterBroadcast = TGetPlotsBroadCast;
1Megu/chia-agent
src/api/ws/harvester/index.ts
TypeScript
ArrowFunction
({ onSelectChange }) => { const { selectedAccount, extensionStatus, setSelectedAccount, deactivate } = useContext(ParachainContext); const { accounts } = usePicassoProvider(); const theme = useTheme(); const dispatch = useAppDispatch(); const handleConfirm = () => { // dispatch(setSelectedAccount(se...
ComposableFi/composable
frontend/ui-picasso/app/components/Organisms/Wallet/PolkadotAccountForm.tsx
TypeScript
ArrowFunction
() => { // dispatch(setSelectedAccount(selected)); dispatch(closePolkadotModal()); }
ComposableFi/composable
frontend/ui-picasso/app/components/Organisms/Wallet/PolkadotAccountForm.tsx
TypeScript
ArrowFunction
() => { if (deactivate) deactivate(); }
ComposableFi/composable
frontend/ui-picasso/app/components/Organisms/Wallet/PolkadotAccountForm.tsx
TypeScript
ArrowFunction
(v, i) => i === selectedAccount
ComposableFi/composable
frontend/ui-picasso/app/components/Organisms/Wallet/PolkadotAccountForm.tsx
TypeScript
ArrowFunction
(account, index) => ( <Button key={index}
ComposableFi/composable
frontend/ui-picasso/app/components/Organisms/Wallet/PolkadotAccountForm.tsx
TypeScript
MethodDeclaration
// setSelected(account); if (setSelectedAccount) { setSelectedAccount(index); }
ComposableFi/composable
frontend/ui-picasso/app/components/Organisms/Wallet/PolkadotAccountForm.tsx
TypeScript
FunctionDeclaration
export default function PhoneMaskedInput(props: TextMaskCustomProps) { const { inputRef, ...other } = props; return ( <MaskedInput {...other} ref={(ref: any) => { inputRef(ref ? ref.inputElement : null); }}
KarelChanivecky/COMP-2800-TEAM-DTC-01-Q-Up
q_up-client/src/components/PhoneMaskedInput.tsx
TypeScript
FunctionDeclaration
export function unMaskPhone(phoneNumber:string) { return phoneNumber.slice(1, 4) + phoneNumber.slice(6, 9) + phoneNumber.slice(10) }
KarelChanivecky/COMP-2800-TEAM-DTC-01-Q-Up
q_up-client/src/components/PhoneMaskedInput.tsx
TypeScript
InterfaceDeclaration
interface TextMaskCustomProps { inputRef: (ref: HTMLInputElement | null) => void; }
KarelChanivecky/COMP-2800-TEAM-DTC-01-Q-Up
q_up-client/src/components/PhoneMaskedInput.tsx
TypeScript
ArrowFunction
() => { beforeEach(() => { // reset mock client ec2ClientMock.reset(); }); it('should return nat gateways associated with passed vpc', async () => { ec2ClientMock.on(DescribeNatGatewaysCommand).resolves({ NatGateways: [ { NatGatewayId: 'natgw1', State: 'associated',...
RishikeshDarandale/vpc-describe
src/tests/network/NatGateway.test.ts
TypeScript
ArrowFunction
() => { // reset mock client ec2ClientMock.reset(); }
RishikeshDarandale/vpc-describe
src/tests/network/NatGateway.test.ts
TypeScript
ArrowFunction
async () => { ec2ClientMock.on(DescribeNatGatewaysCommand).resolves({ NatGateways: [ { NatGatewayId: 'natgw1', State: 'associated', }, ], }); const gw: NatGateway[] = await getNatGateways( 'us-east-1', 'default', 'vpc-12345678' ); ex...
RishikeshDarandale/vpc-describe
src/tests/network/NatGateway.test.ts
TypeScript
ArrowFunction
async () => { ec2ClientMock.on(DescribeNatGatewaysCommand).resolves({ NatGateways: [], }); const gw: NatGateway[] = await getNatGateways( 'us-east-1', 'default', 'vpc-11111111' ); expect(gw.length).toBe(0); }
RishikeshDarandale/vpc-describe
src/tests/network/NatGateway.test.ts
TypeScript
ArrowFunction
async () => { ec2ClientMock.on(DescribeNatGatewaysCommand).rejects({ message: 'failed', }); await expect( getNatGateways('us-east-1', 'default', 'vpc-11111111') ).rejects.toThrow('Error getting the NAT gateways of vpc vpc-11111111'); }
RishikeshDarandale/vpc-describe
src/tests/network/NatGateway.test.ts
TypeScript
ArrowFunction
data => { console.log(data) this.employee = data; }
parmarakhil/schoolManagement
FE/schoolmanagementFE/src/app/update-employee/update-employee.component.ts
TypeScript
ArrowFunction
data => { console.log(data); this.employee = new Employee(); this.gotoList(); }
parmarakhil/schoolManagement
FE/schoolmanagementFE/src/app/update-employee/update-employee.component.ts
TypeScript
ClassDeclaration
@Component({ selector: 'app-update-employee', templateUrl: './update-employee.component.html', styleUrls: ['./update-employee.component.css'] }) export class UpdateEmployeeComponent implements OnInit { id: number; employee: Employee; constructor(private route: ActivatedRoute,private router: Router, p...
parmarakhil/schoolManagement
FE/schoolmanagementFE/src/app/update-employee/update-employee.component.ts
TypeScript
MethodDeclaration
ngOnInit() { this.employee = new Employee(); this.id = this.route.snapshot.params['id']; this.employeeService.getEmployee(this.id) .subscribe(data => { console.log(data) this.employee = data; }, error => console.log(error)); }
parmarakhil/schoolManagement
FE/schoolmanagementFE/src/app/update-employee/update-employee.component.ts
TypeScript
MethodDeclaration
updateEmployee() { this.employeeService.updateEmployee(this.id, this.employee) .subscribe(data => { console.log(data); this.employee = new Employee(); this.gotoList(); }, error => console.log(error)); }
parmarakhil/schoolManagement
FE/schoolmanagementFE/src/app/update-employee/update-employee.component.ts
TypeScript
MethodDeclaration
onSubmit() { this.updateEmployee(); }
parmarakhil/schoolManagement
FE/schoolmanagementFE/src/app/update-employee/update-employee.component.ts
TypeScript
MethodDeclaration
gotoList() { this.router.navigate(['/employees']); }
parmarakhil/schoolManagement
FE/schoolmanagementFE/src/app/update-employee/update-employee.component.ts
TypeScript
ArrowFunction
() => { it("allows comparisons of objects", () => { const example = { 1: 1, 2: 2 }; const hashedObject = hashValue(example); expect(hashValue(example)).toBe(hashedObject); }); it("allows comparisons of arrays", () => { const example = [1, 2]; const hashedArray = hashValue(example); expec...
Barbacoa08/barbie-meals
src/utils/hash-value/hash-value.test.ts
TypeScript
ArrowFunction
() => { const example = { 1: 1, 2: 2 }; const hashedObject = hashValue(example); expect(hashValue(example)).toBe(hashedObject); }
Barbacoa08/barbie-meals
src/utils/hash-value/hash-value.test.ts
TypeScript
ArrowFunction
() => { const example = [1, 2]; const hashedArray = hashValue(example); expect(hashValue(example)).toBe(hashedArray); }
Barbacoa08/barbie-meals
src/utils/hash-value/hash-value.test.ts
TypeScript
ArrowFunction
() => { const example = [ { 1: 1, 2: 2 }, { 3: 3, 4: 4 }, ]; const hashedValue = hashValue(example); expect(hashValue(example)).toBe(hashedValue); }
Barbacoa08/barbie-meals
src/utils/hash-value/hash-value.test.ts
TypeScript
ArrowFunction
( req: Request, payload: ObjectShape ) => { return Yup.object().shape(payload).validate(req.body, { abortEarly: false }) }
HaikalLuzain/todo-list
src/utils/validation.ts
TypeScript
ArrowFunction
(error: any, res: Response) => { const errors: any = {} error.inner.forEach((item: any) => { errors[item.path] = item.message }) return res.status(422).json({ error: { statusCode: StatusCodes.UNPROCESSABLE_ENTITY, message: ReasonPhrases.UNPROCESSABLE_ENTITY, errors, }, }) //...
HaikalLuzain/todo-list
src/utils/validation.ts
TypeScript
ArrowFunction
(item: any) => { errors[item.path] = item.message }
HaikalLuzain/todo-list
src/utils/validation.ts
TypeScript
FunctionDeclaration
// AoT requires an exported function for factories export function createTranslateLoader(http: HttpClient) { // for development // return new TranslateHttpLoader(http, '/start-angular/SB-Admin-BS4-Angular-5/master/dist/assets/i18n/', '.json'); return new TranslateHttpLoader(http, './assets/i18n/', '.json');...
raulluque/MercadoLibreAngular5
src/app/app.module.ts
TypeScript
ClassDeclaration
@NgModule({ imports: [ CommonModule, BrowserModule, BrowserAnimationsModule, HttpClientModule, TranslateModule.forRoot({ loader: { provide: TranslateLoader, useFactory: createTranslateLoader, deps: [HttpClient] ...
raulluque/MercadoLibreAngular5
src/app/app.module.ts
TypeScript
ClassDeclaration
export class Shader extends GLShader { constructor(gl: WebGL2RenderingContext, vertexSrc?: string, fragmentSrc?: string) { super(gl, vertexSrc, fragmentSrc); } apply(): void {} applyMaterial(material: Material): void {} applyMesh(mesh: Mesh): void {} applyNode(node: SceneNode): void {}...
Xan0C/curbl-gltf-viewer
src/scene/shader.ts
TypeScript
MethodDeclaration
apply(): void {}
Xan0C/curbl-gltf-viewer
src/scene/shader.ts
TypeScript
MethodDeclaration
applyMaterial(material: Material): void {}
Xan0C/curbl-gltf-viewer
src/scene/shader.ts
TypeScript
MethodDeclaration
applyMesh(mesh: Mesh): void {}
Xan0C/curbl-gltf-viewer
src/scene/shader.ts
TypeScript
MethodDeclaration
applyNode(node: SceneNode): void {}
Xan0C/curbl-gltf-viewer
src/scene/shader.ts
TypeScript
MethodDeclaration
applyScene(scene: Scene): void {}
Xan0C/curbl-gltf-viewer
src/scene/shader.ts
TypeScript
ClassDeclaration
export class NewsDTO { constructor( public information: string, public dateTime: Date, public culturalSiteName: string, public images: Image[], public id: number ) {} }
ksenija10/KTSNVT_2020_T13
serbioneer-front/src/app/model/news.model.ts
TypeScript
FunctionDeclaration
async function runTestApp (name: string, ...args: any[]) { const appPath = path.join(fixturesPath, 'api', name); const electronPath = process.execPath; const appProcess = cp.spawn(electronPath, [appPath, ...args]); let output = ''; appProcess.stdout.on('data', (data) => { output += data; }); await emitte...
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
() => { it('does not expose internal modules to require', () => { expect(() => { require('clipboard'); }).to.throw(/Cannot find module 'clipboard'/); }); describe('require("electron")', () => { it('always returns the internal electron module', () => { require('electron'); }); }); }
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
() => { expect(() => { require('clipboard'); }).to.throw(/Cannot find module 'clipboard'/); }
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
() => { require('clipboard'); }
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
() => { it('always returns the internal electron module', () => { require('electron'); }); }
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
() => { require('electron'); }
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
(done) => { const options = { key: fs.readFileSync(path.join(certPath, 'server.key')), cert: fs.readFileSync(path.join(certPath, 'server.pem')), ca: [ fs.readFileSync(path.join(certPath, 'rootCA.pem')), fs.readFileSync(path.join(certPath, 'intermediateCA.pem')) ], requ...
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
(req, res) => { if ((req as any).client.authorized) { res.writeHead(200); res.end('<title>authorized</title>'); } else { res.writeHead(401); res.end('<title>denied</title>'); } }
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
() => { const port = (server.address() as net.AddressInfo).port; secureUrl = `https://127.0.0.1:${port}`; done(); }
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
done => { server.close(() => done()); }
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
() => done()
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
() => { it('returns the version field of package.json', () => { expect(app.getVersion()).to.equal('0.1.0'); }); }
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
() => { expect(app.getVersion()).to.equal('0.1.0'); }
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
() => { it('overrides the version', () => { expect(app.getVersion()).to.equal('0.1.0'); app.setVersion('test-version'); expect(app.getVersion()).to.equal('test-version'); app.setVersion('0.1.0'); }); }
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
() => { expect(app.getVersion()).to.equal('0.1.0'); app.setVersion('test-version'); expect(app.getVersion()).to.equal('test-version'); app.setVersion('0.1.0'); }
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
() => { it('with properties', () => { it('returns the name field of package.json', () => { expect(app.name).to.equal('Electron Test Main'); }); it('overrides the name', () => { expect(app.name).to.equal('Electron Test Main'); app.name = 'test-name'; expect(app.na...
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
() => { it('returns the name field of package.json', () => { expect(app.name).to.equal('Electron Test Main'); }); it('overrides the name', () => { expect(app.name).to.equal('Electron Test Main'); app.name = 'test-name'; expect(app.name).to.equal('test-name'); ...
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
() => { expect(app.name).to.equal('Electron Test Main'); }
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
() => { expect(app.name).to.equal('Electron Test Main'); app.name = 'test-name'; expect(app.name).to.equal('test-name'); app.name = 'Electron Test Main'; }
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
() => { it('returns the name field of package.json', () => { expect(app.getName()).to.equal('Electron Test Main'); }); it('overrides the name', () => { expect(app.getName()).to.equal('Electron Test Main'); app.setName('test-name'); expect(app.getName()).to.equal('tes...
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
() => { expect(app.getName()).to.equal('Electron Test Main'); }
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
() => { expect(app.getName()).to.equal('Electron Test Main'); app.setName('test-name'); expect(app.getName()).to.equal('test-name'); app.setName('Electron Test Main'); }
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
() => { it('should not be empty', () => { expect(app.getLocale()).to.not.equal(''); }); }
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
() => { expect(app.getLocale()).to.not.equal(''); }
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
() => { it('should be empty or have length of two', () => { let expectedLength = 2; if (process.platform === 'linux') { // Linux CI machines have no locale. expectedLength = 0; } expect(app.getLocaleCountryCode()).to.be.a('string').and.have.lengthOf(expectedLength); }); ...
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
() => { let expectedLength = 2; if (process.platform === 'linux') { // Linux CI machines have no locale. expectedLength = 0; } expect(app.getLocaleCountryCode()).to.be.a('string').and.have.lengthOf(expectedLength); }
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
() => { it('should be false durings tests', () => { expect(app.isPackaged).to.equal(false); }); }
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
() => { expect(app.isPackaged).to.equal(false); }
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
() => { it('should be false during tests', () => { expect(app.isInApplicationsFolder()).to.equal(false); }); }
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
() => { expect(app.isInApplicationsFolder()).to.equal(false); }
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
() => { let appProcess: cp.ChildProcess | null = null; afterEach(() => { if (appProcess) appProcess.kill(); }); it('emits a process exit event with the code', async () => { const appPath = path.join(fixturesPath, 'api', 'quit-app'); const electronPath = process.execPath; let o...
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
() => { if (appProcess) appProcess.kill(); }
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
async () => { const appPath = path.join(fixturesPath, 'api', 'quit-app'); const electronPath = process.execPath; let output = ''; appProcess = cp.spawn(electronPath, [appPath]); if (appProcess && appProcess.stdout) { appProcess.stdout.on('data', data => { output += data; }); ...
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
data => { output += data; }
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
() => appProcess!.kill()
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
() => { it('throws an error on invalid application policies', () => { expect(() => { app.setActivationPolicy('terrible' as any); }).to.throw(/Invalid activation policy: must be one of 'regular', 'accessory', or 'prohibited'/); }); }
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
() => { expect(() => { app.setActivationPolicy('terrible' as any); }).to.throw(/Invalid activation policy: must be one of 'regular', 'accessory', or 'prohibited'/); }
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
() => { app.setActivationPolicy('terrible' as any); }
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
() => { it('prevents the second launch of app', async function () { this.timeout(120000); const appPath = path.join(fixturesPath, 'api', 'singleton'); const first = cp.spawn(process.execPath, [appPath]); await emittedOnce(first.stdout, 'data'); // Start second app when received output...
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
async () => { const appPath = path.join(fixturesPath, 'api', 'singleton'); const first = cp.spawn(process.execPath, [appPath]); const firstExited = emittedOnce(first, 'exit'); // Wait for the first app to boot. const firstStdoutLines = first.stdout.pipe(split()); while ((await emit...
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
() => { let server: net.Server | null = null; const socketPath = process.platform === 'win32' ? '\\\\.\\pipe\\electron-app-relaunch' : '/tmp/electron-app-relaunch'; beforeEach(done => { fs.unlink(socketPath, () => { server = net.createServer(); server.listen(socketPath); done...
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
done => { fs.unlink(socketPath, () => { server = net.createServer(); server.listen(socketPath); done(); }); }
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
() => { server = net.createServer(); server.listen(socketPath); done(); }
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
(done) => { server!.close(() => { if (process.platform === 'win32') { done(); } else { fs.unlink(socketPath, () => done()); } }); }
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
() => { if (process.platform === 'win32') { done(); } else { fs.unlink(socketPath, () => done()); } }
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
error => done(error)
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
client => { client.once('data', data => { if (String(data) === 'false' && state === 'none') { state = 'first-launch'; } else if (String(data) === 'true' && state === 'first-launch') { done(); } else { done(`Unexpected state: ${state}`); ...
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
data => { if (String(data) === 'false' && state === 'none') { state = 'first-launch'; } else if (String(data) === 'true' && state === 'first-launch') { done(); } else { done(`Unexpected state: ${state}`); } }
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
() => { before(function () { if (process.platform !== 'darwin') { this.skip(); } }); it('sets the current activity', () => { app.setUserActivity('com.electron.testActivity', { testData: '123' }); expect(app.getCurrentActivityType()).to.equal('com.electron.testActivity'); ...
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
() => { app.setUserActivity('com.electron.testActivity', { testData: '123' }); expect(app.getCurrentActivityType()).to.equal('com.electron.testActivity'); }
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
() => { afterEach(closeAllWindows); it('is emitted when visiting a server with a self-signed cert', async () => { const w = new BrowserWindow({ show: false }); w.loadURL(secureUrl); await emittedOnce(app, 'certificate-error'); }); }
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
async () => { const w = new BrowserWindow({ show: false }); w.loadURL(secureUrl); await emittedOnce(app, 'certificate-error'); }
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
() => { let w: BrowserWindow = null as any; afterEach(() => closeWindow(w).then(() => { w = null as any; })); it('should emit browser-window-focus event when window is focused', async () => { const emitted = emittedOnce(app, 'browser-window-focus'); w = new BrowserWindow({ show: false }); ...
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
() => closeWindow(w).then(() => { w = null as any; })
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
() => { w = null as any; }
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
async () => { const emitted = emittedOnce(app, 'browser-window-focus'); w = new BrowserWindow({ show: false }); w.emit('focus'); const [, window] = await emitted; expect(window.id).to.equal(w.id); }
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
async () => { const emitted = emittedOnce(app, 'browser-window-blur'); w = new BrowserWindow({ show: false }); w.emit('blur'); const [, window] = await emitted; expect(window.id).to.equal(w.id); }
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
async () => { const emitted = emittedOnce(app, 'browser-window-created'); w = new BrowserWindow({ show: false }); const [, window] = await emitted; expect(window.id).to.equal(w.id); }
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
async () => { const emitted = emittedOnce(app, 'web-contents-created'); w = new BrowserWindow({ show: false }); const [, webContents] = await emitted; expect(webContents.id).to.equal(w.webContents.id); }
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript
ArrowFunction
async () => { w = new BrowserWindow({ show: false, webPreferences: { nodeIntegration: true, contextIsolation: false } }); await w.loadURL('about:blank'); const emitted = emittedOnce(app, 'renderer-process-crashed'); w.webContents.executeJavaScr...
fisabelle-lmi/electron
spec-main/api-app-spec.ts
TypeScript