• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

streetsidesoftware / regexp-worker / 15691959892

16 Jun 2025 09:07PM UTC coverage: 97.665% (+0.02%) from 97.643%
15691959892

push

github

web-flow
feat!: convert to ESM (#958)

141 of 149 branches covered (94.63%)

Branch coverage included in aggregate %.

15 of 15 new or added lines in 4 files covered. (100.0%)

1 existing line in 1 file now uncovered.

361 of 365 relevant lines covered (98.9%)

82.05 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

60.0
/src/worker/workerThread.ts
1
import { parentPort, isMainThread, Worker } from 'worker_threads';
2
import { createHandler } from './WorkerMessageHandler.js';
3
import { toOutDir } from '../util/toOutDir.js';
4
import { fileURLToPath } from 'url';
5

6
export type { Worker } from 'worker_threads';
7

8
const __filename = fileURLToPath(import.meta.url);
3✔
9

10
let defaultFilename = __filename;
3✔
11

12
// If this isn't the .js file, then we need to point to the .js file.
13
// This can happen when running jest with ts-loader.
14
if (!defaultFilename.match(/\.js$/)) {
3!
UNCOV
15
    defaultFilename = toOutDir(__filename).replace(/ts$/, 'js');
×
16
}
17

18
export function createWorker(filename: string = defaultFilename): Worker {
23✔
19
    return new Worker(filename);
23✔
20
}
21

22
if (!isMainThread && parentPort) {
3!
23
    const handler = createHandler(parentPort);
×
24
    parentPort.once('close', handler.dispose);
×
25
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc