#!/usr/bin/env ruby-2.5

root = File.expand_path("../..", __FILE__)
Dir.chdir root

pid = fork do
  $stderr.reopen "/dev/null" # silence WEBrick output
  exec 'bundle', 'exec', 'rackup', '-p', '4018'
end
sleep 1

status = system('npm', 'run', 'qunit')

Process.kill 'SIGINT', pid
Process.wait pid

exit status
