How to use the yoctodelay function in yoctodelay

To help you get started, we’ve selected a few yoctodelay 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 refined-bitbucket / refined-bitbucket / src / diff-ignore / diff-ignore.spec.js View on Github external
async function performAssertions(t, getNode) {
    const filenames = [
        '/some path/first_file.js',
        '/some path/second_file.js',
        '/some path/third_file.js',
    ]
    const ignorePaths = ['second_file.js']

    const node = getNode(filenames)
    diffIgnore.init(ignorePaths)
    diffIgnore.execute(node)

    // Just wait an arbitrary short amount of time to let
    // the promise of the `await elementReady` to resolve
    await delay(16)

    const header = node.querySelector('section.main > h1, #commit-summary > h1')
        .textContent
    const { filesRemoved, filesChanged } = parseHeader(header)
    t.is(filenames.length, filesChanged)
    t.is(ignorePaths.length, filesRemoved)

    const ig = ignore().add(ignorePaths)

    filenames.forEach(filename => {
        const diff = node.querySelector(
            `section[data-identifier="${escape(filename)}"]`
        )
        const link = node.querySelector(
            `li[data-file-identifier="${escape(filename)}"] > a`
        )
github refined-bitbucket / refined-bitbucket / src / diff-pluses-and-minuses / diff-pluses-and-minuses.spec.js View on Github external
+console.
            <ins>log(msg);</ins>
        
    )
    line.replaceChild(diffedLine, line.firstChild)

    const line2 = udiff.querySelector('#diffed-2')
    const diffedLine2 = <pre class="source">+return;</pre>
    line2.replaceChild(diffedLine2, line2.firstChild)

    const diffContentContainer = udiff.querySelector(
        'div.diff-container &gt; div.diff-content-container.refract-container'
    )
    diffContentContainer.classList.add('word-diff')

    await delay(32)

    // Assert
    t.is(udiff.outerHTML, expected.outerHTML)
})
github refined-bitbucket / refined-bitbucket / src / default-merge-strategy / default-merge-strategy.spec.js View on Github external
class="select aui-select2 select2-offscreen"
            id="id_merge_strategy"
            name="merge_strategy"
        &gt;
            <option data-default-commit-msg="..." value="merge_commit">
                Merge commit
            </option>
            <option data-default-commit-msg="..." value="squash">
                Squash
            </option>
            <option data-default-commit-msg="..." value="fast_forward">
                Fast forward
            </option>
        
    )
    await delay(1000)
    document.body.appendChild(mergeStrategies)

    // Assert
    try {
        await promise
        if (defaultMergeStrategy.scriptAlreadyExists()) {
            t.pass()
        } else {
            t.fail()
        }
    } catch (error) {
        console.error(error)
        t.fail()
    }

    cleanDocumentBody()
github refined-bitbucket / refined-bitbucket / src / load-all-diffs / load-all-diffs.spec.js View on Github external
)
        diffsContainer.appendChild(failedDiff)

        failedDiff
            .querySelector('a.try-again')
            .addEventListener('click', () => {
                // After some other delay, replace the failed diff with a successfull diff
                delay(20).then(() => {
                    failedDiff.remove()
                    addSuccessfullDiff()
                })
            })
    }

    // Add the failed diff after some delay
    delay(20).then(() => {
        if (filename) {
            addFailedDiff()
        } else {
            addSuccessfullDiff()
        }
    })

    return node
}
github refined-bitbucket / refined-bitbucket / src / load-all-diffs / load-all-diffs.spec.js View on Github external
.addEventListener('click', () => {
                // After some other delay, replace the failed diff with a successfull diff
                delay(20).then(() => {
                    failedDiff.remove()
                    addSuccessfullDiff()
                })
            })
    }
github refined-bitbucket / refined-bitbucket / src / close-anchor-branch / close-anchor-branch.spec.js View on Github external
<label class="reset-height" for="id_close_anchor_branch">
                Close branch
            </label>
            <div class="checkbox">
                {checkbox}
                <label class="" for="id_close_anchor_branch">
                    Close <span class="branch-name">anchor-branch</span> after
                    the pull request is merged
                </label>
            </div>
        
    )

    document.body.appendChild(fieldGroup)

    delay(100).then(() =&gt; checkbox.removeAttribute('disabled'))

    await closeAnchorBranch()

    t.is(checkbox.checked, true)
})
github refined-bitbucket / refined-bitbucket / src / pullrequest-template / pullrequest-template.spec.js View on Github external
async t =&gt; {
        setDocumentBodyAttributes()

        const templateContents = 'pull request template contents'

        const atlassianEditor = (
            
                <div>
            
        )
        delay(100).then(() =&gt; document.body.appendChild(atlassianEditor))

        await insertPullrequestTemplate(templateContents)

        const richTemplateContents = marked(templateContents)
        t.is(atlassianEditor.firstChild.innerHTML, richTemplateContents)

        cleanDocumentBody()
        await delay(16)
    }
)</div>
github refined-bitbucket / refined-bitbucket / src / pullrequest-template / pullrequest-template.spec.js View on Github external
async t =&gt; {
        setDocumentBodyAttributes()

        const templateContents = 'pull request template contents'

        const defaultEditor = <textarea id="id_description">        delay(100).then(() =&gt; document.body.appendChild(defaultEditor))

        await insertPullrequestTemplate(templateContents)

        t.is(defaultEditor.value, templateContents)

        cleanDocumentBody()
        await delay(16)
    }
)</textarea>

yoctodelay

Delay a promise a specified amount of time

MIT
Latest version published 3 years ago

Package Health Score

53 / 100
Full package analysis

Popular yoctodelay functions