Definitelytyped: Jasmine (x)it and (x)describe return type wrong?

Created on 13 Jan 2017  路  1Comment  路  Source: DefinitelyTyped/DefinitelyTyped

  • [x] I tried using the latest xxxx/xxxx.d.ts file in this repo and had problems.
  • [x] I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript
  • [x] I have a question that is inappropriate for StackOverflow. (Please ask any appropriate questions there).
  • [x] I want to talk about xxxx/xxxx.d.ts.

    • The authors of that type definition are cc/ @borisyankov @theodorejb @davidparsson

error: Property 'pend' does not exist on type 'void'.

example:

xit('should have a <button>', () => {
    let subject = element(by.tagName('a')).isPresent();
    expect(subject).toBeTruthy();
  }).pend('removed for now');

cause:

declare function describe(description: string, specDefinitions: () => void): void;
declare function fdescribe(description: string, specDefinitions: () => void): void;
declare function xdescribe(description: string, specDefinitions: () => void): void;

declare function it(expectation: string, assertion?: (done: DoneFn) => void, timeout?: number): void;
declare function fit(expectation: string, assertion?: (done: DoneFn) => void, timeout?: number): void;
declare function xit(expectation: string, assertion?: (done: DoneFn) => void, timeout?: number): void;

actual return type of

xit('should have a <button>', () => {
    let subject = element(by.tagName('a')).isPresent();
    expect(subject).toBeTruthy();
  });

:

Spec {
  expectationFactory: [Function],
  resultCallback: [Function: specResultCallback],
  id: 'spec8',
  description: 'should have <button>',
  queueableFn: { fn: [Function], timeout: [Function] },
  beforeAndAfterFns: [Function],
  userContext: [Function],
  onStart: [Function: specStarted],
  getSpecName: [Function],
  expectationResultFactory: [Function],
  queueRunnerFactory: [Function],
  catchingExceptions: [Function],
  throwOnExpectationFailure: false,
  result: 
   { id: 'spec8',
     description: 'should have a <button>',
     fullName: 'Settings should have <button>',
     failedExpectations: [],
     passedExpectations: [],
     pendingReason: 'pendingReason: 'Temporarily disabled with xit' },
  markedPending: true }

Most helpful comment

+1

>All comments

+1

Was this page helpful?
0 / 5 - 0 ratings