• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

vuepress / vuepress-next / 7270727599

20 Dec 2023 03:46AM UTC coverage: 69.405%. Remained the same
7270727599

push

github

meteorlxy
fix(bundler-vite): serve assets with absolute path in dev server correctly (close #1442)

332 of 464 branches covered (0.0%)

Branch coverage included in aggregate %.

648 of 948 relevant lines covered (68.35%)

48.83 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

6.67
/packages/utils/src/console/withSpinner.ts
1
import process from 'node:process'
2
import type { Ora } from 'ora'
3
import ora from 'ora'
4
import { formatMs } from './formatMs.js'
5

6
export const withSpinner =
7
  (msg: string) =>
36✔
8
  async <T>(target: (spinner?: Ora) => Promise<T>): Promise<T> => {
×
9
    if (process.env.DEBUG) {
×
10
      return target()
×
11
    }
12

13
    const start = Date.now()
×
14
    const spinner = ora()
×
15
    try {
×
16
      spinner.start(msg)
×
17
      const result = await target(spinner)
×
18
      spinner.succeed(`${msg} - done in ${formatMs(Date.now() - start)}`)
×
19
      return result
×
20
    } catch (e) {
21
      spinner.fail(`${msg} - failed in ${formatMs(Date.now() - start)}`)
×
22
      throw e
×
23
    }
24
  }
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc