Democrats have been sharply divided over the Trump-backed spending bill to avoid a government shutdown at midnight.