How to use @testdeck/core - 4 common examples

To help you get started, we’ve selected a few @testdeck/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github testdeck / testdeck / packages / @testdeck / mocha / index.ts View on Github external
beforeAll(name: string, callback: core.CallbackOptionallyAsync, settings?: core.LifecycleSettings): void {
    before(applyTimings(callback, settings));
  },
  beforeEach(name: string, callback: core.CallbackOptionallyAsync, settings?: core.LifecycleSettings): void {
    beforeEach(applyTimings(callback, settings));
  },
  afterEach(name: string, callback: core.CallbackOptionallyAsync, settings?: core.LifecycleSettings): void {
    afterEach(applyTimings(callback, settings));
  },
  afterAll(name: string, callback: core.CallbackOptionallyAsync, settings?: core.LifecycleSettings): void {
    after(applyTimings(callback, settings));
  }
};

class MochaClassTestUI extends core.ClassTestUI {
  // TODO: skipOnError, @context
  public constructor(runner: core.TestRunner = mochaRunner) {
    super(runner);
  }
}

const mochaDecorators = new MochaClassTestUI();

export = mochaDecorators;
github testdeck / testdeck / packages / @testdeck / jest / index.ts View on Github external
},
  beforeAll(name: string, callback: core.CallbackOptionallyAsync, settings?: core.LifecycleSettings): void {
    beforeAll(callback, settings && settings.timeout);
  },
  beforeEach(name: string, callback: core.CallbackOptionallyAsync, settings?: core.LifecycleSettings): void {
    beforeEach(callback, settings && settings.timeout);
  },
  afterEach(name: string, callback: core.CallbackOptionallyAsync, settings?: core.LifecycleSettings): void {
    afterEach(callback, settings && settings.timeout);
  },
  afterAll(name: string, callback: core.CallbackOptionallyAsync, settings?: core.LifecycleSettings): void {
    afterAll(callback, settings && settings.timeout);
  }
};

class JestClassTestUI extends core.ClassTestUI {
  public constructor(runner: core.TestRunner = jestRunner) {
    super(runner);
  }
}

const jestDecorators = new JestClassTestUI();

export = jestDecorators;
github testdeck / testdeck / packages / @testdeck / jasmine / index.ts View on Github external
},
  beforeAll(name: string, callback: core.CallbackOptionallyAsync, settings?: core.LifecycleSettings): void {
    beforeAll(callback, settings && settings.timeout);
  },
  beforeEach(name: string, callback: core.CallbackOptionallyAsync, settings?: core.LifecycleSettings): void {
    beforeEach(callback, settings && settings.timeout);
  },
  afterEach(name: string, callback: core.CallbackOptionallyAsync, settings?: core.LifecycleSettings): void {
    afterEach(callback, settings && settings.timeout);
  },
  afterAll(name: string, callback: core.CallbackOptionallyAsync, settings?: core.LifecycleSettings): void {
    afterAll(callback, settings && settings.timeout);
  }
};

class JestClassTestUI extends core.ClassTestUI {
  public constructor(runner: core.TestRunner = jestRunner) {
    super(runner);
  }
}

const jestDecorators = new JestClassTestUI();

export = jestDecorators;
github testdeck / testdeck / packages / @testdeck / mocha / index.ts View on Github external
function applyTimings(fn: any, settings: any): any {
  if (settings) {
    if (fn.length === 1) {
      return core.wrap(function(done) {
        if (settings.retries !== undefined) { this.retries(settings.retries); }
        if (settings.slow !== undefined) { this.slow(settings.slow); }
        if (settings.timeout !== undefined) { this.timeout(settings.timeout); }
        return fn.call(this, done);
      }, fn);
    } else {
      return core.wrap(function() {
        if (settings.retries !== undefined) { this.retries(settings.retries); }
        if (settings.slow !== undefined) { this.slow(settings.slow); }
        if (settings.timeout !== undefined) { this.timeout(settings.timeout); }
        return fn.call(this);
      }, fn);
    }
  } else {
    return fn;
  }
}

@testdeck/core

Core framework for decorator based object oriented testing

Apache-2.0
Latest version published 2 years ago

Package Health Score

57 / 100
Full package analysis

Popular @testdeck/core functions