Skip to content

Commit

Permalink
attempt to work around a ci-only problem
Browse files Browse the repository at this point in the history
  • Loading branch information
evanw committed Jan 17, 2023
1 parent 1d9e158 commit 2163bf6
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions scripts/js-api-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -2769,16 +2769,17 @@ import "after/alias";
// threading.
async rapidRebuildCancel({ esbuild }) {
const context = await esbuild.context({
entryPoints: ['foo'],
entryPoints: ['entry'],
logLevel: 'silent',
plugins: [{
name: 'x',
name: '',
setup(build) {
build.onStart(() => {
// This should ensure that the build can't end instantly without
// calling back out to JavaScript. Since JavaScript is single-
// threaded, that means we get to call "cancel()" before "rebuild()"
// ends.
build.onResolve({ filter: /.*/ }, args => {
return { path: args.path, namespace: '∞' }
})
build.onLoad({ filter: /.*/ }, async (args) => {
await new Promise(r => setTimeout(r, 10))
return { contents: 'import ' + JSON.stringify(args.path + '.') }
})
},
}],
Expand Down

0 comments on commit 2163bf6

Please sign in to comment.