On the now-distant April day that Theresa May called the general election, Jeremy Corbyn's Labour opponents satisfiedly remarked that he would now face the ultimate test. Having tried and failed to remove him as leader last summer, they were content to let him "own the result". With defeat regarded as inevitable, they hoped that party members would turn away from Corbyn. Some MPs predicted that Conservative attacks on the Labour leader over the IRA and terrorism would push the party's vote share as low as 20 per cent.

But Labour's campaign has defied such apocalyptic expectations. Rather than sinking, support for the party has surged. The Tories' poll lead has halved on the most pessimistic measure (to 11 points) and fallen to just one point on the most optimistic. Crucially, this has been because of the Labour campaign, not in spite of it. The party's manifesto, stuffed with popular policies, was well-received and Corbyn impressed in TV appearances (with his personal rating improving from -42 to -2). Labour's disciplined campaign has shown the leader in his best light - addressing packed rallies - and has avoided the divisions that plagued Ed Miliband in 2015.

For all this, most in the party's ranks, including Corbyn allies, expect the party to lose seats. Though Labour is on course to exceed the 30.4 per cent won by Miliband, candidates fear the opposition is amassing support in constituencies it already holds. Insiders are optimistic about the party's prospects in London, Wales and the North West but fear losses in the North East and the Midlands - the UK's defining electoral battleground.

Corbyn's opponents have long been clear that the only test of success is beating the Conservatives. As Chuka Umunna recently told me: “What I have no time for is any debate about degrees of failure and what degree of failure is worst or best for the Labour Party. I’m in the Dave Prentis [Unison general secretary] camp on these things, which is: the only thing we should be seeking is government. What that means for me is that the test in this election for the Labour Party is getting more seats than the Conservative Party. It’s not getting more seats than we got in 1983 or 1931: it’s getting more seats than the Conservatives now."

But non-Corbynites acknowledge that in the eye of the members, he will have succeeded. "They'll say he fought a good campaign - and he has," a candidate told me. A YouGov poll previously showed that 68 per cent of Labour members believed Corbyn should resign in the event of defeat - a figure that has likely significantly shrunk.

For this reason, senior Labour figures are urging colleagues to avoid a precipitous challenge to Corbyn (who allies say will remain leader). Unlike in 2015, when leadership bids were launched immediately after the party's defeat, they say members need to be given space to "grieve" and absorb any defeat. "It will feel like they've been dumped," one candidate said, "dumped by the electorate".

Having misjudged the mood of activists in 2015, paving the way for Corbyn's election, the "moderates" are determined not to do so again. "An immediate challenge is exactly what the left wants," a candidate told me. Another said: "Jeremy is just like Obi-Wan Kenobi," a former shadow cabinet minister said, "if you strike him down, he only comes back stronger."

Yvette Cooper, Chuka Umunna and Lisa Nandy are among those expected to stand for the leadership. But rather than launching early bids, they will wait to take the pulse of the membership (YouGov is expected to conduct new polling) and gradually advance the argument that the party needs change in order to beat the Tories. Though Corbyn supporters will argue he has created a platform for victory, and deserves another chance (like Neil Kinnock), others will say that Labour lost to an "incompetent, directionless Tory party" that fought "the most dismal campaign in living memory".

Corbyn opponents predict that he will fare less well once back in parliament (which returns on 13 June) and off the campaign trail. A key test, one said, would be whether MPs returned to the frontbench or stayed off in order to avoid strengthening the leader's position.

Some want to delay any leadership contest in order to secure the return of the electoral college system (under which MPs held a third of the vote) at the party's autumn conference - an option publicly proposed by Tom Watson. But one figure warned against investing hope in this course: "The machine has lamentably failed to deliver in two Labour leadership elections and the Unite general secretary contest."

Corbyn supporters, meanwhile, will seek to reduce the nomination threshold from 15 per cent of MPs/MEPs to just 5 per cent in order to ensure a permanent left presence in leadership elections. But election defeat, their opponents say, would undercut their claim to speak for "the people". The Parliamentary Labour Party, one figure promised, would not play the role of "saboteurs". Rather, as Momentum and others launch protests against the Tories, they hope that members will come to desire a leader who can win the country and not just the party.