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

vuepress / vuepress-next / 3792858757

pending completion
3792858757

push

github

GitHub
fix(theme-default): preserve url params when switching language (#1211)

325 of 468 branches covered (69.44%)

Branch coverage included in aggregate %.

682 of 1002 relevant lines covered (68.06%)

42.19 hits per line

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

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

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

12
    const start = Date.now()
×
13
    const spinner = ora()
×
14
    try {
×
15
      spinner.start(msg)
×
16
      const result = await target(spinner)
×
17
      spinner.succeed(`${msg} - done in ${formatMs(Date.now() - start)}`)
×
18
      return result
×
19
    } catch (e) {
20
      spinner.fail(`${msg} - failed in ${formatMs(Date.now() - start)}`)
×
21
      throw e
×
22
    }
23
  }
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