fixup! refactor(napi): use get_uv_event_loop instead of uv_default_loop

This commit is contained in:
Ouyang Yadong 2020-08-18 14:11:19 +08:00
parent 00454eb577
commit 1329409ca4

View file

@ -25,11 +25,9 @@ test('should execute future on libuv thread pool', async (t) => {
t.deepEqual(readFileSync(filepath), fileContent) t.deepEqual(readFileSync(filepath), fileContent)
}) })
test('should execute future on libuv thread pool of "Worker"', async (t) => { if (threadMod && napiVersion >= 4) {
test('should execute future on libuv thread pool of "Worker"', async (t) => {
// Test in threads if current Node.js supports "worker_threads".` // Test in threads if current Node.js supports "worker_threads".`
if (!threadMod || napiVersion < 4) {
return
}
const { Worker } = threadMod const { Worker } = threadMod
const script = resolve(__dirname, './uv_worker.js') const script = resolve(__dirname, './uv_worker.js')
@ -41,4 +39,5 @@ test('should execute future on libuv thread pool of "Worker"', async (t) => {
}) })
t.is(success, true) t.is(success, true)
}) })
}