Skip to content

Commit 1fbad93

Browse files
committed
test(bindings/js): unfix segfault
1 parent c7c19e3 commit 1fbad93

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

bindings/js/minify.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,9 @@ func minifyFile(cmediatype, cinput, coutput *C.char) *C.char {
166166

167167
//export minifyCleanup
168168
func minifyCleanup() {
169-
os.Exit(0)
169+
// This will fix the worker thread segfault test by explicitly ending the node
170+
// process with a 0 signal
171+
// os.Exit(0)
170172
}
171173

172174
func main() {}

bindings/js/test/worker.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ if (isMainThread) {
1919
throw "unexpected output using worker threads: '"+output+"' instead of '"+expected+"'";
2020
}
2121
await worker.terminate();
22+
console.log("success!"); // this needs to be printed
2223
} else {
2324
const { config, string } = await import('@tdewolff/minify');
2425
config({'html-keep-document-tags': true})

0 commit comments

Comments
 (0)