···11-name: "\U0001F41E Bug report"
11+name: 🐞 Bug report
22description: Report an issue with Vitest
33labels: [pending triage]
44body:
+4-4
.github/ISSUE_TEMPLATE/feature_request.yml
···11-name: "\U0001F680 New feature proposal"
11+name: 🚀 New feature proposal
22description: Propose a new feature to be added to Vite
33-labels: ["enhancement: pending triage"]
33+labels: ['enhancement: pending triage']
44body:
55 - type: markdown
66 attributes:
···1010 id: feature-description
1111 attributes:
1212 label: Clear and concise description of the problem
1313- description: "As a developer using Vitest I want [goal / wish] so that [benefit]. If you intend to submit a PR for this issue, tell us in the description. Thanks!"
1313+ description: 'As a developer using Vitest I want [goal / wish] so that [benefit]. If you intend to submit a PR for this issue, tell us in the description. Thanks!'
1414 validations:
1515 required: true
1616 - type: textarea
1717 id: suggested-solution
1818 attributes:
1919 label: Suggested solution
2020- description: "We could provide following implementation..."
2020+ description: We could provide following implementation...
2121 validations:
2222 required: true
2323 - type: textarea
···110110export function assertTypes(value: unknown, name: string, types: string[]): void {
111111 const receivedType = typeof value
112112 const pass = types.includes(receivedType)
113113- if (!pass) throw new TypeError(`${name} value must be ${types.join(' or ')}, received "${receivedType}"`)
113113+ if (!pass)
114114+ throw new TypeError(`${name} value must be ${types.join(' or ')}, received "${receivedType}"`)
114115}
+2-1
packages/vitest/src/utils/source-map.ts
···101101 source: string,
102102 offset: number | Position,
103103): Position {
104104- if (typeof offset !== 'number') return offset
104104+ if (typeof offset !== 'number')
105105+ return offset
105106 if (offset > source.length) {
106107 throw new Error(
107108 `offset is longer than source length! offset ${offset} > length ${source.length}`,