-
-
Notifications
You must be signed in to change notification settings - Fork 629
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move pool cluster promise test to builtin-runner
- Loading branch information
Showing
2 changed files
with
33 additions
and
24 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
test/builtin-runner/integration/pool-cluster/test-promise-wrapper.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { describe, it, before, after } from 'node:test'; | ||
import assert from 'node:assert'; | ||
import common from '../../../common.js'; | ||
import { createPoolCluster } from "../../../../promise.js" | ||
|
||
describe('Test pool cluster', { timeout: 1000 }, () => { | ||
|
||
it('should propagate warn event to promise wrapper', (t, done) => { | ||
|
||
const poolCluster = createPoolCluster(); | ||
/* eslint-disable no-invalid-this */ | ||
poolCluster | ||
.once('warn', function () { | ||
assert.equal(this, poolCluster); | ||
done(); | ||
}) | ||
/* eslint-enable no-invalid-this */ | ||
poolCluster.poolCluster.emit('warn', new Error()); | ||
}); | ||
|
||
it('should propagate remove event to promise wrapper', (t, done) => { | ||
|
||
const poolCluster = createPoolCluster(); | ||
/* eslint-disable no-invalid-this */ | ||
poolCluster | ||
.once('remove', function () { | ||
assert.equal(this, poolCluster); | ||
done(); | ||
}); | ||
/* eslint-enable no-invalid-this */ | ||
poolCluster.poolCluster.emit('remove'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters