Skip to content

test: fix snippet test #1398

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,18 @@ exports[`snippet import snippet 1`] = `
exports[`snippet import snippet with highlight multiple lines 1`] = `
<div class="highlight-lines">
<div class="highlighted">&nbsp;</div>
</div>
<div class="highlighted">&nbsp;</div>
<div class="highlighted">&nbsp;</div><br>
</div>export default function () {
// ..
}
`;

exports[`snippet import snippet with highlight single line 1`] = `
<div class="highlight-lines">
<div class="highlighted">&nbsp;</div>
</div>
<div class="highlighted">&nbsp;</div><br>
<div class="highlighted">&nbsp;</div><br>
</div>export default function () {
// ..
}
`;
2 changes: 1 addition & 1 deletion packages/@vuepress/markdown/__tests__/snippet.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import snippet from '../lib/snippet.js'
import highlightLines from '../lib/highlightLines.js'

const md = Md().use(snippet)
const mdH = Md().use(snippet).use(highlightLines)
const mdH = Md().use(highlightLines).use(snippet)

describe('snippet', () => {
test('import snippet', () => {
Expand Down
11 changes: 5 additions & 6 deletions scripts/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@ if (args.p) {
rawArgs.splice(i, 2)
}

const jestRunner = createJestRunner(
[
'--config', 'scripts/jest.config.js',
'--runInBand',
...(regex ? [regex] : [])
])
const jestRunner = createJestRunner([
'--config', 'scripts/jest.config.js',
'--runInBand',
...(regex ? [regex] : [])
])

// ensure the basic temp files were genereatod
createApp({
Expand Down