Skip to content

Commit

Permalink
test(bindings/js): unfix segfault
Browse files Browse the repository at this point in the history
  • Loading branch information
perrin4869 committed Jul 10, 2022
1 parent c7c19e3 commit 1fbad93
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bindings/js/minify.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ func minifyFile(cmediatype, cinput, coutput *C.char) *C.char {

//export minifyCleanup
func minifyCleanup() {
os.Exit(0)
// This will fix the worker thread segfault test by explicitly ending the node
// process with a 0 signal
// os.Exit(0)
}

func main() {}
1 change: 1 addition & 0 deletions bindings/js/test/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ if (isMainThread) {
throw "unexpected output using worker threads: '"+output+"' instead of '"+expected+"'";
}
await worker.terminate();
console.log("success!"); // this needs to be printed
} else {
const { config, string } = await import('@tdewolff/minify');
config({'html-keep-document-tags': true})
Expand Down

0 comments on commit 1fbad93

Please sign in to comment.