Macy's on Wednesday reported quarterly earnings that topped analysts' expectations, saying strong digital sales boosted results, while the retailer continues to make investments to improve its stores.

The department store chain also raised its earnings outlook for the full year, expecting a strong holiday season.

Its shares whipsawed on the news, however, climbing more than 2 percent Wednesday morning but recently were down nearly 8 percent. The stock has rallied more than 80 percent from a year ago. And some analysts say they're still waiting to see if Macy's can pull off a strong fourth quarter, where it faces tougher comparisons.

"This is only the start of Macy's journey," GlobalData Retail Managing Director Neil Saunders said. "A lot more work is still needed to make Macy's a unique and compelling retail destination."

Here's what Macy's reported compared with what Wall Street was expecting, based on a survey of analysts by Refinitiv:

* Earnings per share: 27 cents, adjusted, vs. 14 cents expected

* Revenue: $5.40 billion vs. $5.41 billion expected

* Same-store sales: up 3.3 percent, on an owned plus licensed basis, vs. growth of 2.8 percent expected

"We are ready for the fourth quarter," CEO Jeff Gennette told CNBC. "I think the backdrop for consumer spending is good, their confidence is strong, the dotcom business is really humming. … For stores, we are going into the fourth quarter in a healthy place with momentum."

Macy's reported fiscal third-quarter net income of $62 million, or 20 cents per share, up from $30 million, or 10 cents per share, a year earlier. Excluding one-time items, Macy's earned 27 cents, ahead of the 14 cents expected by analysts polled by Refinitiv.

Net sales climbed to $5.40 billion from $5.28 billion one year ago, falling roughly in line with analysts' expectations for $5.41 billion. The company said digital sales were up a double-digit percentage, fueled by growth of sales made via mobile devices. Macy's is on track to reach $1 billion in mobile sales by the end of the year.

Sales at stores open for at least 12 months were up 3.3 percent, marking the fourth consecutive quarter of same-store sales growth for Macy's, and surpassing Wall Street expectations for growth of 2.8 percent.

Looking to the full year, Macy's is now calling for earnings per share to fall within a range of $4.10 to $4.30, up from $3.95 to $4.15. It also narrowed its forecast for same-stores sales to climb between 2.3 percent and 2.5 percent, compared with a prior range of 2.1 percent to 2.5 percent. Estimates for net sales narrowed to an expected increase of between 0.3 percent and 0.7 percent, compared with flat to up 0.7 percent, previously.

Hoping to avoid the same fate as now-bankrupt Sears, Macy's has been testing new technology and other concepts in stores to lure shoppers and grow sales.

The department store chain is adding mini marketplaces to some locations to sell goods from lesser-known and local brands. It's adding augmented reality devices to stores to let shoppers try on make-up virtually, along with virtual reality headsets to let shoppers see furniture in real life. All of Macy's stores are also expected to be equipped with mobile checkout by the end of the year.

The company, meanwhile, has been adding its off-price brand, Macy's Backstage, to existing full-line shops to compete with the likes of TJ Maxx, Nordstrom Rack and Ross Stores. Macy's has said stores with Backstage see two times more shopping trips, with basket sizes up an average of 30 percent.

Macy's is also starting to experiment with smaller stores, hoping to trim staffing and inventory costs. Retailers including Kohl's, Nordstrom and Target have either opened smaller locations or trimmed larger ones in recent months, as more people shop online.

According to Gennette, the company is making progress with its turnaround plans, and it's showing up in results. He said October was the strongest month for Macy's during the third quarter, particularly in the last three weeks. He added the company is "ahead of schedule" for hiring 80,000 workers this holiday season, despite many retailers facing headwinds amid a tight labor market in the U.S.

"While Macy's has been working to make improvements in its own business, we believe this performance sets an optimistic tone for the sector," Telsey Advisory Group analyst Dana Telsey said in a research note.

Other retailers including Kohl's, Nordstrom and J.C. Penney are set to report quarterly earnings in the coming days.