How to use the human-interval function in human-interval

To help you get started, we’ve selected a few human-interval 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 bipbop / jurischain / test / saucelabs.spec.ts View on Github external
import humanInterval from 'human-interval'

import { createDriver, ie11, latestChrome, latestFirefox, latestSafari } from './create-driver'
import initServer from './server'

jest.setTimeout(humanInterval('30 minutes') as number)

describe('saucelabs tests', function() {
  it('should call \'jurischain\' event ', async function() {
    const baseUrl = await initServer()
    const builderConfiguration = ie11
    const driver = await createDriver(undefined, undefined, builderConfiguration)

    try {
      await driver.manage().window().maximize()
      await driver.get(baseUrl)

      await driver.wait(async driver => {
        const element = await driver.findElement( { className: 'jurischain-captcha__text' })
        const text = await element.getText()

        if (text === 'Seu acesso foi validado com sucesso.') {
github cypress-io / cypress / packages / desktop-gui / src / update / update-banner.jsx View on Github external
componentDidMount () {
    if (!appStore.isDev) {
      this.checkId = setInterval(this._checkForUpdate, human('60 minutes'))
      this._checkForUpdate()
    }
  }
github bipbop / harlan / src / plugins / lib / icheques / harlan.js View on Github external
let queryTry = (callback, query, data = {}) => controller.server.call(query, {
            cache: true,
            timeout: humanInterval('30 seconds'),
            data: Object.assign({
                documento: task[0]
            }, data),
            success: ret => callback(null, ret),
            error: () => callback('Can\'t use this query')
        });
github bipbop / harlan / src / plugins / lib / icheques / harlan.js View on Github external
if (!$('.ichequesAccountOverview').length) {
            controller.call('icheques::report::overview', false, false);
        }

        showChecks(task[1], result, section);

        let mensagem = section[0].find('h3').text();

        if (controller.confs.ccf) {

            controller.server.call('SELECT FROM \'SEEKLOC\'.\'CCF\'', {
                data: {
                    documento: task[0]
                },
                timeout: humanInterval('20 seconds'),
                success: ret => {
                    let totalRegistro = parseInt($(ret).find('BPQL > body > data > resposta > totalRegistro').text());

                    if (!totalRegistro) {
                        section[0].find('h3').text(mensagem += ' Não há cheques sem fundo.');
                        return;
                    }

                    let qteOcorrencias = $(ret).find('BPQL > body > data > sumQteOcorrencias').text();

                    let v1 = moment($('dataUltOcorrencia', ret).text(), 'DD/MM/YYYY');
                    let v2 = moment($('ultimo', ret).text(), 'DD/MM/YYYY');

                    mensagem += ` Total de registros CCF: ${qteOcorrencias} com data da última ocorrência: ${(v1.isAfter(v2) ? v1 : v2).format('DD/MM/YYYY')}.`;
                    section[0].find('h3').text(mensagem);
                    section[0].addClass('warning');

human-interval

Human readable time measurements

MIT
Latest version published 3 years ago

Package Health Score

56 / 100
Full package analysis

Popular human-interval functions