Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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`
)
+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 > div.diff-content-container.refract-container'
)
diffContentContainer.classList.add('word-diff')
await delay(32)
// Assert
t.is(udiff.outerHTML, expected.outerHTML)
})
class="select aui-select2 select2-offscreen"
id="id_merge_strategy"
name="merge_strategy"
>
<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()
)
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
}
.addEventListener('click', () => {
// After some other delay, replace the failed diff with a successfull diff
delay(20).then(() => {
failedDiff.remove()
addSuccessfullDiff()
})
})
}
.then(() => delay(500))
.then(() => {
.then(() => delay(500))
.then(() => {
<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(() => checkbox.removeAttribute('disabled'))
await closeAnchorBranch()
t.is(checkbox.checked, true)
})
async t => {
setDocumentBodyAttributes()
const templateContents = 'pull request template contents'
const atlassianEditor = (
<div>
)
delay(100).then(() => document.body.appendChild(atlassianEditor))
await insertPullrequestTemplate(templateContents)
const richTemplateContents = marked(templateContents)
t.is(atlassianEditor.firstChild.innerHTML, richTemplateContents)
cleanDocumentBody()
await delay(16)
}
)</div>
async t => {
setDocumentBodyAttributes()
const templateContents = 'pull request template contents'
const defaultEditor = <textarea id="id_description"> delay(100).then(() => document.body.appendChild(defaultEditor))
await insertPullrequestTemplate(templateContents)
t.is(defaultEditor.value, templateContents)
cleanDocumentBody()
await delay(16)
}
)</textarea>