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

vuepress / vuepress-next / 7353675564

29 Dec 2023 04:14AM UTC coverage: 69.529%. Remained the same
7353675564

push

github

meteorlxy
feat: bump to vue 3.4

338 of 471 branches covered (0.0%)

Branch coverage included in aggregate %.

650 of 950 relevant lines covered (68.42%)

52.07 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