Skip to content

Commit 8fe3538

Browse files
authored
test: tweak generateCodeFrame test (#19812)
1 parent 3013138 commit 8fe3538

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/vite/src/node/__tests__/__snapshots__/utils.spec.ts.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,23 +115,23 @@ exports[`generateCodeFrames > start with number 4`] = `
115115
"
116116
`;
117117

118-
exports[`generateCodeFrames > start with postion 1`] = `
118+
exports[`generateCodeFrames > start with position 1`] = `
119119
"
120120
1 | import foo from './foo'
121121
| ^
122122
2 | foo()
123123
"
124124
`;
125125

126-
exports[`generateCodeFrames > start with postion 2`] = `
126+
exports[`generateCodeFrames > start with position 2`] = `
127127
"
128128
1 | import foo from './foo'
129129
| ^
130130
2 | foo()
131131
"
132132
`;
133133

134-
exports[`generateCodeFrames > start with postion 3`] = `
134+
exports[`generateCodeFrames > start with position 3`] = `
135135
"
136136
1 | import foo from './foo'
137137
2 | foo()

packages/vite/src/node/__tests__/utils.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ describe('generateCodeFrames', () => {
248248
import foo from './foo'
249249
foo()
250250
`.trim()
251-
const sourceCrLf = source.replace(/\n/, '\r\n')
251+
const sourceCrLf = source.replaceAll('\n', '\r\n')
252252
const longSource = `
253253
import foo from './foo'
254254
@@ -276,7 +276,7 @@ foo()
276276
expectSnapshot(generateCodeFrame(source, 24))
277277
})
278278

279-
test('start with postion', () => {
279+
test('start with position', () => {
280280
expectSnapshot(generateCodeFrame(source, { line: 1, column: 0 }))
281281
expectSnapshot(generateCodeFrame(source, { line: 1, column: 1 }))
282282
expectSnapshot(generateCodeFrame(source, { line: 2, column: 0 }))

0 commit comments

Comments
 (0)