Skip to content

Commit 3d19f40

Browse files
shigmaulivz
authored andcommitted
test: fix import code snippet test (#1398)
1 parent bec1488 commit 3d19f40

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

packages/@vuepress/markdown/__tests__/__snapshots__/snippet.spec.js.snap

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,18 @@ exports[`snippet import snippet 1`] = `
1010
exports[`snippet import snippet with highlight multiple lines 1`] = `
1111
<div class="highlight-lines">
1212
<div class="highlighted">&nbsp;</div>
13-
</div>
13+
<div class="highlighted">&nbsp;</div>
14+
<div class="highlighted">&nbsp;</div><br>
15+
</div>export default function () {
16+
// ..
17+
}
1418
`;
1519
1620
exports[`snippet import snippet with highlight single line 1`] = `
1721
<div class="highlight-lines">
18-
<div class="highlighted">&nbsp;</div>
19-
</div>
22+
<div class="highlighted">&nbsp;</div><br>
23+
<div class="highlighted">&nbsp;</div><br>
24+
</div>export default function () {
25+
// ..
26+
}
2027
`;

packages/@vuepress/markdown/__tests__/snippet.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import snippet from '../lib/snippet.js'
44
import highlightLines from '../lib/highlightLines.js'
55

66
const md = Md().use(snippet)
7-
const mdH = Md().use(snippet).use(highlightLines)
7+
const mdH = Md().use(highlightLines).use(snippet)
88

99
describe('snippet', () => {
1010
test('import snippet', () => {

scripts/test.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@ if (args.p) {
1313
rawArgs.splice(i, 2)
1414
}
1515

16-
const jestRunner = createJestRunner(
17-
[
18-
'--config', 'scripts/jest.config.js',
19-
'--runInBand',
20-
...(regex ? [regex] : [])
21-
])
16+
const jestRunner = createJestRunner([
17+
'--config', 'scripts/jest.config.js',
18+
'--runInBand',
19+
...(regex ? [regex] : [])
20+
])
2221

2322
// ensure the basic temp files were genereatod
2423
createApp({

0 commit comments

Comments
 (0)