Skip to content
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

test: fix generate coverage report & test failure when not supported language with Prismjs #271

Merged
merged 2 commits into from Feb 2, 2022

Conversation

yoshinorin
Copy link
Member

@yoshinorin yoshinorin commented Jan 31, 2022

Add comment for review.

// Use language: 'plain' to simplify the test
const result = prismHighlight(input, { tab: ' ', lang: 'plain' });
// Use language: 'plain-text' for not supported language with Prism
const result = prismHighlight(input, { tab: ' ', lang: 'plain-text' });
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this test-case seems to test for not supported language with Prism. But, if we specify lang: 'plain the prismHighlight function will return Prism.highlight result.

So, we want to pass through return escapeHTML(code); in this test-case, but current test code pass through return Prism.highlight(code, Prism.languages[language], language);.

I think it happened before, not recently.

@yoshinorin
Copy link
Member Author

Hmm... coverage report sent failure when node 14.x 🤔

@@ -0,0 +1,2 @@
# https://github.com/istanbuljs/nyc#common-configuration-options
all: true
Copy link
Member Author

@yoshinorin yoshinorin Feb 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The generated coverage report file (lcov.info) is empty if we do not specify all : true.

@yoshinorin yoshinorin changed the title test: fix test failure when not supported language with Prismjs test: fix generate coverage & test failure when not supported language with Prismjs Feb 1, 2022
@yoshinorin yoshinorin changed the title test: fix generate coverage & test failure when not supported language with Prismjs test: fix generate coverage report & test failure when not supported language with Prismjs Feb 1, 2022
@yoshinorin yoshinorin merged commit 37a2c6f into master Feb 2, 2022
@yoshinorin yoshinorin deleted the test/fix-failure branch February 2, 2022 10:15
nevilm-lt pushed a commit to nevilm-lt/hexo-util that referenced this pull request Apr 22, 2022
…language with Prismjs (hexojs#271)

* test: fix test failure when not supported language with Prismjs

* test: fix lcov.info is empty
nevilm-lt pushed a commit to nevilm-lt/hexo-util that referenced this pull request Apr 22, 2022
…language with Prismjs (hexojs#271)

* test: fix test failure when not supported language with Prismjs

* test: fix lcov.info is empty
nevilm-lt pushed a commit to nevilm-lt/hexo-util that referenced this pull request Apr 22, 2022
…language with Prismjs (hexojs#271)

* test: fix test failure when not supported language with Prismjs

* test: fix lcov.info is empty
nevilm-lt pushed a commit to nevilm-lt/hexo-util that referenced this pull request Apr 22, 2022
…language with Prismjs (hexojs#271)

* test: fix test failure when not supported language with Prismjs

* test: fix lcov.info is empty
himanshiLt pushed a commit to himanshiLt/hexo-util that referenced this pull request Apr 25, 2022
…language with Prismjs (hexojs#271)

* test: fix test failure when not supported language with Prismjs

* test: fix lcov.info is empty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants