SHANGHAI -- Elon Musk said he’s never seen a factory built so quickly, and now he’s about find out if it’s up to the task.

Tesla Inc.’s new Shanghai Gigafactory, which only broke ground in January, is weeks from starting mass production of electric sedans. China’s first plant wholly owned by a foreign carmaker — and Tesla’s first outside the U.S. — is a crucial test of Musk’s bid to keep his carmaker profitable as he bets big on the world’s biggest market for electric vehicles.

Musk has predicted that Tesla will make at least 1,000 cars a week in Shanghai by the end of the year — a volume the company’s original factory in California spent months trying to hit — and has hinted that a weekly rate of 3,000 is a target at some point.

With Tesla’s volatile stock price and strained finances, investors will be watching closely how the ramp-up unfolds. The multibillion-dollar investment will be a deciding factor to determine whether Tesla will be able to take on local competitors and fend off challenges by the likes of Daimler and BMW.