Back | Home
الـ Path الحالي: /home/picotech/domains/instantly.picotech.app/public_html/public/uploads/../uploads/../../../../instantly.picotech.app/homes/../../wa.picotech.app/public_html/node_modules/escape-html/.././object-assign/../@hapi/../inherits/../punycode/../lodash.clonedeep/../dotenv/../fresh/../.bin/../stream-shift/../validator/../duplexify/../thread-stream/test
الملفات الموجودة في هذا الـ Path:
.
..
base.test.js
bench.test.js
bundlers.test.js
close-on-gc.js
commonjs-fallback.test.js
create-and-exit.js
custom-worker.js
dir with spaces
end.test.js
error.js
esm.test.mjs
exit.js
helper.d.ts
helper.js
indexes.js
multibyte-chars.test.mjs
port.js
string-limit-2.test.js
string-limit.test.js
thread-management.test.js
to-file-on-destroy.js
to-file-on-final.js
to-file.js
to-file.mjs
transpiled.test.js
ts
ts.test.ts
uncaughtException.js
unhandledRejection.js

مشاهدة ملف: bundlers.test.js

'use strict'

const { test } = require('tap')
const { join } = require('path')
const { file } = require('./helper')
const ThreadStream = require('..')

test('bundlers support', function (t) {
  t.plan(1)

  globalThis.__bundlerPathsOverrides = {
    'thread-stream-worker': join(__dirname, 'custom-worker.js')
  }

  const dest = file()

  process.on('uncaughtException', error => {
    console.log(error)
  })

  const stream = new ThreadStream({
    filename: join(__dirname, 'to-file.js'),
    workerData: { dest },
    sync: true
  })

  stream.worker.removeAllListeners('message')
  stream.worker.once('message', message => {
    t.equal(message.code, 'CUSTOM-WORKER-CALLED')
  })

  stream.end()
})