type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
ArrowFunction |
() => {
comp.onInputText('New Tag');
input.triggerEventHandler('keydown', enterKeyDownEventObj);
expect(comp.items[comp.items.length - 1]).toEqual('New Tag');
} | jmarquez-stratio/egeo | projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts | TypeScript |
ArrowFunction |
() => {
comp.type = 'number';
comp.onInputText('56');
input.triggerEventHandler('keydown', enterKeyDownEventObj);
expect(comp.items[comp.items.length - 1]).toEqual(56);
comp.onInputText('100.54');
input.triggerEventHandler('keydown', enterKeyDownEventObj);
... | jmarquez-stratio/egeo | projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts | TypeScript |
ArrowFunction |
() => {
comp.type = 'integer';
comp.onInputText('567');
input.triggerEventHandler('keydown', enterKeyDownEventObj);
expect(comp.items[comp.items.length - 1]).toEqual(567);
} | jmarquez-stratio/egeo | projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts | TypeScript |
ArrowFunction |
() => {
comp.items = [];
comp.type = 'integer';
comp.onInputText('invalid integer');
input.triggerEventHandler('keydown', enterKeyDownEventObj);
expect(comp.items.length).toBe(0);
comp.onInputText('58.2');
input.triggerEventHandler('keydown', enterKeyDow... | jmarquez-stratio/egeo | projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts | TypeScript |
ArrowFunction |
() => {
comp.items = [];
comp.type = 'integer';
comp.onInputText('invalid integer');
input.triggerEventHandler('keydown', enterKeyDownEventObj);
expect(comp.items.length).toBe(0);
comp.onInputText('56¬ANumber');
input.triggerEventHandler('keydown', en... | jmarquez-stratio/egeo | projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts | TypeScript |
ArrowFunction |
() => {
TestBed.configureTestingModule({
imports: [FormsModule, ReactiveFormsModule, StTagInputModule, StClickOutsideModule],
declarations: [StTagInputTestReactiveComponent]
})
.overrideComponent(StTagInputComponent, {
set: { changeDetection: ChangeD... | jmarquez-stratio/egeo | projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture = TestBed.createComponent(StTagInputTestReactiveComponent);
comp = fixture.componentInstance;
compTagInput = comp.tagInput;
fixture.detectChanges();
} | jmarquez-stratio/egeo | projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture.destroy();
} | jmarquez-stratio/egeo | projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture.detectChanges();
expect(compTagInput.items).toEqual([]);
comp.reactiveForm.get('tags').setValue(simpleTags);
fixture.detectChanges();
expect(compTagInput.items).toEqual(simpleTags);
} | jmarquez-stratio/egeo | projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts | TypeScript |
ArrowFunction |
() => {
compTagInput.infoMessage = fakeInfoMessage;
fixture.detectChanges();
expect(fixture.nativeElement.querySelector('.info-message')).not.toBeNull();
comp.reactiveForm.get('tags').setValue(simpleTags);
fixture.detectChanges();
expect(fixture.nativeElement.qu... | jmarquez-stratio/egeo | projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts | TypeScript |
ArrowFunction |
() => {
const responseFunction = jasmine.createSpy('response');
comp.reactiveForm.get('tags').valueChanges.subscribe(responseFunction);
fixture.detectChanges();
const id: string = 'test-id';
(fixture.elementRef.nativeElement as HTMLElement).id = id;
compTagInput.l... | jmarquez-stratio/egeo | projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts | TypeScript |
ArrowFunction |
() => {
comp.reactiveForm.get('tags').setValue([]);
fixture.detectChanges();
expect(comp.reactiveForm.valid).toBeFalsy();
comp.reactiveForm.get('tags').setValue(['New Tag']);
fixture.detectChanges();
expect(comp.reactiveForm.valid).toBeTruthy();
} | jmarquez-stratio/egeo | projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts | TypeScript |
ArrowFunction |
() => {
compTagInput.type = 'text';
compTagInput.regularExpression = ipFormat;
compTagInput.ngOnInit();
fixture.detectChanges();
compTagInput.innerInputContent = 'New Tag';
fixture.detectChanges();
const input: DebugElement = fixture.debugElement.query(B... | jmarquez-stratio/egeo | projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts | TypeScript |
ArrowFunction |
() => {
beforeEach(() => {
compTagInput.type = 'number';
compTagInput.ngOnInit();
fixture.detectChanges();
});
it('and user types a text with letters and other symbols different to a dot, it wont be added', () => {
compTagInput.innerInputConte... | jmarquez-stratio/egeo | projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts | TypeScript |
ArrowFunction |
() => {
compTagInput.type = 'number';
compTagInput.ngOnInit();
fixture.detectChanges();
} | jmarquez-stratio/egeo | projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts | TypeScript |
ArrowFunction |
() => {
compTagInput.innerInputContent = 'New Tag';
fixture.detectChanges();
const input: DebugElement = fixture.debugElement.query(By.css('.inner-input'));
input.triggerEventHandler('keydown', {
keyCode: 188, preventDefault: () => {
}
... | jmarquez-stratio/egeo | projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts | TypeScript |
ArrowFunction |
() => {
} | jmarquez-stratio/egeo | projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts | TypeScript |
ArrowFunction |
() => {
(<any> comp.reactiveForm.controls).tags.setValue(['text', 2, 6.67]);
fixture.detectChanges();
expect(compTagInput.items.length).toEqual(2);
expect(compTagInput.items).toEqual([2, 6.67]);
} | jmarquez-stratio/egeo | projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts | TypeScript |
ArrowFunction |
() => {
beforeEach(() => {
compTagInput.type = 'integer';
compTagInput.ngOnInit();
fixture.detectChanges();
});
it('and user types a text with characters different to numbers, it wont be added', () => {
compTagInput.innerInputContent = 'New Ta... | jmarquez-stratio/egeo | projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts | TypeScript |
ArrowFunction |
() => {
compTagInput.type = 'integer';
compTagInput.ngOnInit();
fixture.detectChanges();
} | jmarquez-stratio/egeo | projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts | TypeScript |
ArrowFunction |
() => {
compTagInput.innerInputContent = 'New Tag';
fixture.detectChanges();
const input: DebugElement = fixture.debugElement.query(By.css('.inner-input'));
input.triggerEventHandler('keydown', {
keyCode: 188, preventDefault: () => {
}
... | jmarquez-stratio/egeo | projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts | TypeScript |
ArrowFunction |
() => {
(<any> comp.reactiveForm.controls).tags.setValue(['text', 78, 6]);
fixture.detectChanges();
expect(compTagInput.items.length).toEqual(2);
expect(compTagInput.items).toEqual([78, 6]);
} | jmarquez-stratio/egeo | projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts | TypeScript |
ArrowFunction |
() => {
describe('Template form instance', () => {
let fixture: ComponentFixture<StTagInputTestTemplateComponent>;
let comp: StTagInputTestTemplateComponent;
let compTagInput: StTagInputComponent;
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [Forms... | jmarquez-stratio/egeo | projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts | TypeScript |
ArrowFunction |
() => {
let fixture: ComponentFixture<StTagInputTestTemplateComponent>;
let comp: StTagInputTestTemplateComponent;
let compTagInput: StTagInputComponent;
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [FormsModule, StTagInputModule],
declara... | jmarquez-stratio/egeo | projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts | TypeScript |
ArrowFunction |
() => {
TestBed.configureTestingModule({
imports: [FormsModule, StTagInputModule],
declarations: [StTagInputTestTemplateComponent]
}).compileComponents(); // compile template and css
} | jmarquez-stratio/egeo | projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture = TestBed.createComponent(StTagInputTestTemplateComponent);
comp = fixture.componentInstance;
compTagInput = comp.tagInput;
} | jmarquez-stratio/egeo | projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture.detectChanges();
fixture.whenStable().then(() => { // Form generation it's asynchronous
expect(compTagInput.items).toEqual([]);
comp.templateDrivenForm.form.get('tags').setValue(simpleTags);
fixture.detectChanges();
expect(compTagInput.... | jmarquez-stratio/egeo | projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts | TypeScript |
ArrowFunction |
() => { // Form generation it's asynchronous
expect(compTagInput.items).toEqual([]);
comp.templateDrivenForm.form.get('tags').setValue(simpleTags);
fixture.detectChanges();
expect(compTagInput.items).toEqual(simpleTags);
} | jmarquez-stratio/egeo | projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts | TypeScript |
ArrowFunction |
() => {
const responseFunction = jasmine.createSpy('response');
fixture.detectChanges();
fixture.whenStable().then(() => { // Form generation it's asynchronous
comp.templateDrivenForm.form.get('tags').valueChanges.subscribe(responseFunction);
const id: string = 'test... | jmarquez-stratio/egeo | projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts | TypeScript |
ArrowFunction |
() => { // Form generation it's asynchronous
comp.templateDrivenForm.form.get('tags').valueChanges.subscribe(responseFunction);
const id: string = 'test-id';
(fixture.elementRef.nativeElement as HTMLElement).id = id;
compTagInput.label = 'Test';
compTagInput... | jmarquez-stratio/egeo | projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture.detectChanges();
fixture.whenStable().then(() => { // Form generation it's asynchronous
comp.templateDrivenForm.form.get('tags').setValue([]);
fixture.detectChanges();
expect(comp.templateDrivenForm.valid).toBeFalsy();
comp.templateDriv... | jmarquez-stratio/egeo | projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts | TypeScript |
ArrowFunction |
() => { // Form generation it's asynchronous
comp.templateDrivenForm.form.get('tags').setValue([]);
fixture.detectChanges();
expect(comp.templateDrivenForm.valid).toBeFalsy();
comp.templateDrivenForm.form.get('tags').setValue(['New Tag']);
fixture.detectChan... | jmarquez-stratio/egeo | projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts | TypeScript |
ArrowFunction |
() => {
it('if a forbidden value list is not introduced as input, user can introduce whatever he wants', async(() => {
fixture.detectChanges();
fixture.whenStable().then(() => { // Form generation it's asynchronous
compTagInput.innerInputContent = 'New Tag';
... | jmarquez-stratio/egeo | projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture.detectChanges();
fixture.whenStable().then(() => { // Form generation it's asynchronous
compTagInput.innerInputContent = 'New Tag';
fixture.detectChanges();
const input: DebugElement = fixture.debugElement.query(By.css('.inner-input... | jmarquez-stratio/egeo | projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts | TypeScript |
ArrowFunction |
() => { // Form generation it's asynchronous
compTagInput.innerInputContent = 'New Tag';
fixture.detectChanges();
const input: DebugElement = fixture.debugElement.query(By.css('.inner-input'));
input.triggerEventHandler('keydown', {
keyCode... | jmarquez-stratio/egeo | projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts | TypeScript |
ArrowFunction |
() => {
} | jmarquez-stratio/egeo | projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts | TypeScript |
ArrowFunction |
() => {
compTagInput.forbiddenValues = ['forbidden value'];
fixture.detectChanges();
fixture.whenStable().then(() => { // Form generation it's asynchronous
compTagInput.innerInputContent = 'New Tag';
fixture.detectChanges();
const input... | jmarquez-stratio/egeo | projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts | TypeScript |
ArrowFunction |
() => { // Form generation it's asynchronous
compTagInput.innerInputContent = 'New Tag';
fixture.detectChanges();
const input: DebugElement = fixture.debugElement.query(By.css('.inner-input'));
input.triggerEventHandler('keydown', {
keyCode... | jmarquez-stratio/egeo | projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts | TypeScript |
ArrowFunction |
(done) => {
compTagInput.regularExpression = ipFormat;
fixture.detectChanges();
fixture.whenStable().then(() => { // Form generation it's asynchronous
fixture.whenStable().then(() => { // Form generation it's asynchronous
compTagInput.innerInputContent = '1.1.1.1'... | jmarquez-stratio/egeo | projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts | TypeScript |
ArrowFunction |
() => { // Form generation it's asynchronous
fixture.whenStable().then(() => { // Form generation it's asynchronous
compTagInput.innerInputContent = '1.1.1.1';
fixture.detectChanges();
const input: DebugElement = fixture.debugElement.query(By.css('.inner-input'... | jmarquez-stratio/egeo | projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts | TypeScript |
ArrowFunction |
() => { // Form generation it's asynchronous
compTagInput.innerInputContent = '1.1.1.1';
fixture.detectChanges();
const input: DebugElement = fixture.debugElement.query(By.css('.inner-input'));
input.triggerEventHandler('keydown', {
keyCode... | jmarquez-stratio/egeo | projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts | TypeScript |
ClassDeclaration |
@Component({
template: `
<form [formGroup]="reactiveForm" novalidate autocomplete="off">
<st-tag-input #tagInput
name="tags"
formControlName="tags"
placeholder="placeholder"
label="Test"
tooltip="Test Help"
id="test"
... | jmarquez-stratio/egeo | projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts | TypeScript |
ClassDeclaration |
@Component({
changeDetection: ChangeDetectionStrategy.OnPush,
template: `
<form #templateDrivenForm="ngForm" novalidate autocomplete="off">
<st-tag-input #tagInput
class="st-form-field"
id="test"
placeholder="placeholder"
name="tags"
labe... | jmarquez-stratio/egeo | projects/egeo/src/lib/st-tag-input/st-tag-input.component.spec.ts | TypeScript |
ArrowFunction |
() => {
let component: RingComponent;
let fixture: ComponentFixture<RingComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ RingComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(RingComponent);
componen... | darinvivekanandan/pbxnew | src/app/views/ring/ring.component.spec.ts | TypeScript |
ArrowFunction |
() => {
TestBed.configureTestingModule({
declarations: [ RingComponent ]
})
.compileComponents();
} | darinvivekanandan/pbxnew | src/app/views/ring/ring.component.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture = TestBed.createComponent(RingComponent);
component = fixture.componentInstance;
fixture.detectChanges();
} | darinvivekanandan/pbxnew | src/app/views/ring/ring.component.spec.ts | TypeScript |
ArrowFunction |
() => {
for (const scenario of this.suite.scenarios) {
describe(scenario.name, () => {
let containerBuilder: ContainerBuilder
let container: Container
before("before scenario", async () => {
if (this.before) {
await this.before()
}
... | tmorin/ceb | packages/ceb-inversion-testing-mocha/src/index.ts | TypeScript |
ArrowFunction |
() => {
let containerBuilder: ContainerBuilder
let container: Container
before("before scenario", async () => {
if (this.before) {
await this.before()
}
})
before("create the container builder", async () => {
containerB... | tmorin/ceb | packages/ceb-inversion-testing-mocha/src/index.ts | TypeScript |
ArrowFunction |
async () => {
if (this.before) {
await this.before()
}
} | tmorin/ceb | packages/ceb-inversion-testing-mocha/src/index.ts | TypeScript |
ArrowFunction |
async () => {
containerBuilder = this.provide()
} | tmorin/ceb | packages/ceb-inversion-testing-mocha/src/index.ts | TypeScript |
ArrowFunction |
async () => {
if (this.configure) {
await Promise.resolve(this.configure(containerBuilder))
}
} | tmorin/ceb | packages/ceb-inversion-testing-mocha/src/index.ts | TypeScript |
ArrowFunction |
async () => {
if (scenario.configure) {
await Promise.resolve(scenario.configure(containerBuilder))
}
} | tmorin/ceb | packages/ceb-inversion-testing-mocha/src/index.ts | TypeScript |
ArrowFunction |
async () => {
container = await containerBuilder.build().initialize()
} | tmorin/ceb | packages/ceb-inversion-testing-mocha/src/index.ts | TypeScript |
ArrowFunction |
async () => {
if (scenario.before) {
await scenario.before(container)
}
} | tmorin/ceb | packages/ceb-inversion-testing-mocha/src/index.ts | TypeScript |
ArrowFunction |
async () => {
await scenario.execute(container)
} | tmorin/ceb | packages/ceb-inversion-testing-mocha/src/index.ts | TypeScript |
ArrowFunction |
async () => {
if (scenario.after) {
await scenario.after(container)
}
} | tmorin/ceb | packages/ceb-inversion-testing-mocha/src/index.ts | TypeScript |
ArrowFunction |
async () => {
await container.dispose()
} | tmorin/ceb | packages/ceb-inversion-testing-mocha/src/index.ts | TypeScript |
ArrowFunction |
async () => {
if (this.after) {
await this.after()
}
} | tmorin/ceb | packages/ceb-inversion-testing-mocha/src/index.ts | TypeScript |
ClassDeclaration | /**
* An implementation of {@link AbstractTestSuiteExecutor} dedicated for Mocha.
*
* Instances should be created using the builder {@link MochaTestSuiteExecutorBuilder}.
*/
export class MochaTestSuiteExecutor extends AbstractTestSuiteExecutor<Suite> {
constructor(
suite: TestSuite,
before?: Callback,
... | tmorin/ceb | packages/ceb-inversion-testing-mocha/src/index.ts | TypeScript |
ClassDeclaration | /**
* An extension of {@link AbstractTestSuiteExecutorBuilder} dedicated for Mocha.
*
* @example run a test suite with an dummy scenario
* ```typescript
* import {TestScenarioBuilder, TestSuiteBuilder} from "@tmorin/ceb-inversion-testing-core";
* import {MochaTestSuiteExecutor} from "@tmorin/ceb-inversion-testing... | tmorin/ceb | packages/ceb-inversion-testing-mocha/src/index.ts | TypeScript |
MethodDeclaration |
execute(): Suite {
return describe(this.suite.name, () => {
for (const scenario of this.suite.scenarios) {
describe(scenario.name, () => {
let containerBuilder: ContainerBuilder
let container: Container
before("before scenario", async () => {
if (this.before)... | tmorin/ceb | packages/ceb-inversion-testing-mocha/src/index.ts | TypeScript |
MethodDeclaration | /**
* Create a builder.
* @param suite the suite
*/
static get(suite: TestSuite | TestSuiteBuilder) {
if (suite instanceof TestSuiteBuilder) {
return new MochaTestSuiteExecutorBuilder(suite.build())
}
return new MochaTestSuiteExecutorBuilder(suite)
} | tmorin/ceb | packages/ceb-inversion-testing-mocha/src/index.ts | TypeScript |
MethodDeclaration | /**
* Build the executor.
*/
build(): TestSuiteExecutor<Suite> {
return new MochaTestSuiteExecutor(this._suite, this._before, this._provider, this._configurer, this._after)
} | tmorin/ceb | packages/ceb-inversion-testing-mocha/src/index.ts | TypeScript |
ArrowFunction |
() => {
beforeEach(() => TestBed.configureTestingModule({}));
it('should be created', () => {
const service: ConfigurationService = TestBed.inject(ConfigurationService);
expect(service).toBeTruthy();
});
} | buildmotion/buildmotion | libs/configuration/src/lib/configuration.service.spec.ts | TypeScript |
ArrowFunction |
() => {
const service: ConfigurationService = TestBed.inject(ConfigurationService);
expect(service).toBeTruthy();
} | buildmotion/buildmotion | libs/configuration/src/lib/configuration.service.spec.ts | TypeScript |
ArrowFunction |
(
name: BlockName,
parent?: DescribeBlock,
mode?: BlockMode,
): DescribeBlock => {
let _mode = mode;
if (parent && !mode) {
// If not set explicitly, inherit from the parent describe.
_mode = parent.mode;
}
return {
children: [],
hooks: [],
mode: _mode,
name: convertDescriptorToS... | aleclarson/jest | packages/jest-circus/src/utils.ts | TypeScript |
ArrowFunction |
(
fn: TestFn | undefined,
mode: TestMode,
name: TestName,
parent: DescribeBlock,
timeout: number | undefined,
asyncError: Exception,
): TestEntry => ({
asyncError,
duration: null,
errors: [],
fn,
invocations: 0,
mode,
name: convertDescriptorToString(name),
parent,
startedAt: null,
statu... | aleclarson/jest | packages/jest-circus/src/utils.ts | TypeScript |
ArrowFunction |
(describeBlock: DescribeBlock): boolean => {
const {hasFocusedTests, testNamePattern} = getState();
const hasOwnEnabledTests = describeBlock.tests.some(
test =>
!(
test.mode === 'skip' ||
(hasFocusedTests && test.mode !== 'only') ||
(testNamePattern && !testNamePattern.test(getTes... | aleclarson/jest | packages/jest-circus/src/utils.ts | TypeScript |
ArrowFunction |
test =>
!(
test.mode === 'skip' ||
(hasFocusedTests && test.mode !== 'only') ||
(testNamePattern && !testNamePattern.test(getTestID(test)))
) | aleclarson/jest | packages/jest-circus/src/utils.ts | TypeScript |
ArrowFunction |
(describe: DescribeBlock) => {
const result: {
beforeAll: Array<Hook>;
afterAll: Array<Hook>;
} = {
afterAll: [],
beforeAll: [],
};
if (hasEnabledTest(describe)) {
for (const hook of describe.hooks) {
switch (hook.type) {
case 'beforeAll':
result.beforeAll.push(hook... | aleclarson/jest | packages/jest-circus/src/utils.ts | TypeScript |
ArrowFunction |
(test: TestEntry) => {
const result: {
beforeEach: Array<Hook>;
afterEach: Array<Hook>;
} = {afterEach: [], beforeEach: []};
let block: DescribeBlock | undefined | null = test.parent;
do {
const beforeEachForCurrentBlock = [];
for (const hook of block.hooks) {
switch (hook.type) {
... | aleclarson/jest | packages/jest-circus/src/utils.ts | TypeScript |
ArrowFunction |
(describe: DescribeBlock): boolean =>
describe.tests.length > 0 || describe.children.some(describeBlockHasTests) | aleclarson/jest | packages/jest-circus/src/utils.ts | TypeScript |
ArrowFunction |
(timeout: number, isHook: boolean) =>
`Exceeded timeout of ${timeout}ms for a ${
isHook ? 'hook' : 'test'
}.\nUse jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test.` | aleclarson/jest | packages/jest-circus/src/utils.ts | TypeScript |
ArrowFunction |
(
fn: AsyncFn,
testContext: TestContext | undefined,
{isHook, timeout}: {isHook?: boolean | null; timeout: number},
): Promise<any> => {
let timeoutID: NodeJS.Timeout;
return new Promise((resolve, reject) => {
timeoutID = setTimeout(
() => reject(_makeTimeoutMessage(timeout, !!isHook)),
time... | aleclarson/jest | packages/jest-circus/src/utils.ts | TypeScript |
ArrowFunction |
(resolve, reject) => {
timeoutID = setTimeout(
() => reject(_makeTimeoutMessage(timeout, !!isHook)),
timeout,
);
// If this fn accepts `done` callback we return a promise that fulfills as
// soon as `done` called.
if (fn.length) {
const done = (reason?: Error | string): void => {... | aleclarson/jest | packages/jest-circus/src/utils.ts | TypeScript |
ArrowFunction |
() => reject(_makeTimeoutMessage(timeout, !!isHook)) | aleclarson/jest | packages/jest-circus/src/utils.ts | TypeScript |
ArrowFunction |
(reason?: Error | string): void => {
const isError =
reason && (reason as Error).message && (reason as Error).stack;
return reason
? reject(
isError
? reason
: new Error(`Failed: ${prettyFormat(reason, {maxDepth: 3})}`),
)
... | aleclarson/jest | packages/jest-circus/src/utils.ts | TypeScript |
ArrowFunction |
() => {
// If timeout is not cleared/unrefed the node process won't exit until
// it's resolved.
timeoutID.unref && timeoutID.unref();
clearTimeout(timeoutID);
} | aleclarson/jest | packages/jest-circus/src/utils.ts | TypeScript |
ArrowFunction |
error => {
timeoutID.unref && timeoutID.unref();
clearTimeout(timeoutID);
throw error;
} | aleclarson/jest | packages/jest-circus/src/utils.ts | TypeScript |
ArrowFunction |
(test: TestEntry): number | null => {
const {startedAt} = test;
return typeof startedAt === 'number' ? Date.now() - startedAt : null;
} | aleclarson/jest | packages/jest-circus/src/utils.ts | TypeScript |
ArrowFunction |
(
describeBlock: DescribeBlock,
unhandledErrors: Array<Error>,
): RunResult => ({
testResults: makeTestResults(describeBlock),
unhandledErrors: unhandledErrors.map(_formatError),
}) | aleclarson/jest | packages/jest-circus/src/utils.ts | TypeScript |
ArrowFunction |
(describeBlock: DescribeBlock): TestResults => {
const {includeTestLocationInResult} = getState();
let testResults: TestResults = [];
for (const test of describeBlock.tests) {
const testPath = [];
let parent: TestEntry | DescribeBlock = test;
do {
testPath.unshift(parent.name);
} while ((pa... | aleclarson/jest | packages/jest-circus/src/utils.ts | TypeScript |
ArrowFunction |
(test: TestEntry) => {
const titles = [];
let parent: TestEntry | DescribeBlock = test;
do {
titles.unshift(parent.name);
} while ((parent = parent.parent));
titles.shift(); // remove TOP_DESCRIBE_BLOCK_NAME
return titles.join(' ');
} | aleclarson/jest | packages/jest-circus/src/utils.ts | TypeScript |
ArrowFunction |
(
errors?: Exception | [Exception | undefined, Exception],
): string => {
let error;
let asyncError;
if (Array.isArray(errors)) {
error = errors[0];
asyncError = errors[1];
} else {
error = errors;
asyncError = new Error();
}
if (error) {
if (error.stack) {
return error.stack;... | aleclarson/jest | packages/jest-circus/src/utils.ts | TypeScript |
ArrowFunction |
(
describeBlock: DescribeBlock,
error: Exception,
asyncError: Exception,
) => {
for (const test of describeBlock.tests) {
test.errors.push([error, asyncError]);
}
for (const child of describeBlock.children) {
addErrorToEachTestUnderDescribe(child, error, asyncError);
}
} | aleclarson/jest | packages/jest-circus/src/utils.ts | TypeScript |
ArrowFunction |
(condition: unknown, message?: string) => {
if (!condition) {
throw new Error(message);
}
} | aleclarson/jest | packages/jest-circus/src/utils.ts | TypeScript |
ClassDeclaration |
@ObjectType()
export class Company implements CompanyInterface {
@Field()
id: string;
@Field()
name: string;
@Field({ nullable: true })
description?: string;
@Field()
active: boolean;
@Field()
plan: number;
} | Blira/company-service | src/company/company.model.ts | TypeScript |
ClassDeclaration |
@Component({
selector: 'foundation-6-framework',
template: `
<select-widget-widget
[layoutNode]="layoutNode"
[dataIndex]="dataIndex"
[layoutIndex]="layoutIndex"></select-widget-widget>`,
})
export class Foundation6Component implements OnInit, OnChanges {
@Input() layoutNode: any;
@Input()... | alimohammad/angular2-json-schema-form | src/frameworks/foundation-6.component.ts | TypeScript |
MethodDeclaration |
ngOnChanges() { } | alimohammad/angular2-json-schema-form | src/frameworks/foundation-6.component.ts | TypeScript |
FunctionDeclaration | /**
* Android Policy entity for Intune MAM.
*/
export function getAndroidMAMPolicyByName(args: GetAndroidMAMPolicyByNameArgs, opts?: pulumi.InvokeOptions): Promise<GetAndroidMAMPolicyByNameResult> {
if (!opts) {
opts = {}
}
if (!opts.version) {
opts.version = utilities.getVersion();
}... | pulumi/pulumi-azure-nextgen | sdk/nodejs/intune/v20150114preview/getAndroidMAMPolicyByName.ts | TypeScript |
InterfaceDeclaration |
export interface GetAndroidMAMPolicyByNameArgs {
/**
* Location hostName for the tenant
*/
readonly hostName: string;
/**
* Unique name for the policy
*/
readonly policyName: string;
/**
* select specific fields in entity.
*/
readonly select?: string;
} | pulumi/pulumi-azure-nextgen | sdk/nodejs/intune/v20150114preview/getAndroidMAMPolicyByName.ts | TypeScript |
InterfaceDeclaration | /**
* Android Policy entity for Intune MAM.
*/
export interface GetAndroidMAMPolicyByNameResult {
readonly accessRecheckOfflineTimeout?: string;
readonly accessRecheckOnlineTimeout?: string;
readonly appSharingFromLevel?: string;
readonly appSharingToLevel?: string;
readonly authentication?: strin... | pulumi/pulumi-azure-nextgen | sdk/nodejs/intune/v20150114preview/getAndroidMAMPolicyByName.ts | TypeScript |
FunctionDeclaration | // tslint:disable-next-line:cyclomatic-complexity
export default function targetInstancesByTimeZone(
instance: any,
targets: { [index: string]: any }
): boolean {
if (!instance) {
return false;
}
if (!targets) {
return true;
}
const instanceTimeZone = instance.targets &&
... | Bodrus/flagship | packages/fsengage/src/modules/cms/providers/core/targets/targetInstancesByTimeZone.ts | TypeScript |
ClassDeclaration |
export default class Terminal extends S22 {
render() {
return <h3>Complete!</h3>
}
} | ansonmiu0214/SessionTS-Examples | TwoBuyer/buyer-b/src/components/Terminal.tsx | TypeScript |
MethodDeclaration |
render() {
return <h3>Complete!</h3>
} | ansonmiu0214/SessionTS-Examples | TwoBuyer/buyer-b/src/components/Terminal.tsx | TypeScript |
ArrowFunction |
data => {
if (data.msgRet == "1") {
this.toastService.addSingle("error", "", "شما در سیستم احراز هویت نشده اید")
this.router.navigate(['/otp']);
}
else if (data.msgRet == "2") {
this.toastService.addSingle("error", "", "چنین کاربری در سیستم تعریف نشده ا... | rroona/Ng-Prime-master | src/app/core/recover-password/recover-password.component.ts | TypeScript |
ArrowFunction |
err => { console.log(err) } | rroona/Ng-Prime-master | src/app/core/recover-password/recover-password.component.ts | TypeScript |
ClassDeclaration |
@Component({
selector: 'app-recover-password',
templateUrl: './recover-password.component.html',
styleUrls: ['./recover-password.component.css']
})
export class RecoverPasswordComponent implements OnInit {
userform: FormGroup;
currentUser;
version: string;
constructor(private smsService: SmsService, pr... | rroona/Ng-Prime-master | src/app/core/recover-password/recover-password.component.ts | TypeScript |
MethodDeclaration |
ngOnInit() {
this.currentUser = this.userService.getcurrentUser;
//console.log(this.currentUser)
this.userform = this.fb.group({
//'Mobile': new FormControl('', Validators.required),
'NatioalCode': new FormControl('', Validators.compose([Validators.required, Validators.minLength(10), Validators... | rroona/Ng-Prime-master | src/app/core/recover-password/recover-password.component.ts | TypeScript |
MethodDeclaration |
checkNationalCode() {
if (this.userform.controls["NatioalCode"].value != undefined && this.userform.controls["NatioalCode"].value.length == 10) {
if (this.userform.controls["NatioalCode"].value == '0000000000' || this.userform.controls["NatioalCode"].value == '1111111111' || this.userform.controls["NatioalCo... | rroona/Ng-Prime-master | src/app/core/recover-password/recover-password.component.ts | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.