mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-18 18:33:42 +00:00
Improve test coverage
This commit is contained in:
parent
54b32d7f4b
commit
eb59f7f694
3
.github/workflows/linter.yml
vendored
3
.github/workflows/linter.yml
vendored
@ -12,9 +12,8 @@ jobs:
|
||||
- name: Install Dependencies
|
||||
run: npm install
|
||||
- run: npm run eslint
|
||||
- run: npm test
|
||||
- name: Coverage
|
||||
run: npm run test-cov
|
||||
run: npx nyc --reporter=lcovonly npm test
|
||||
env:
|
||||
CI: true
|
||||
- name: Coveralls
|
||||
|
||||
@ -77,7 +77,7 @@
|
||||
{%- if theme.footer.powered %}
|
||||
<div class="powered-by">
|
||||
{%- set next_site = 'https://theme-next.js.org' if theme.scheme === 'Gemini' else 'https://theme-next.js.org/' + theme.scheme | lower + '/' %}
|
||||
{{- __('footer.powered', next_url('https://hexo.io', 'Hexo', {class: 'theme-link'}) + ' & ' + next_url(next_site, 'NexT.' + theme.scheme, {class: 'theme-link'})) }}
|
||||
{{- __('footer.powered', next_url('https://hexo.io', 'Hexo') + ' & ' + next_url(next_site, 'NexT.' + theme.scheme)) }}
|
||||
</div>
|
||||
{%- endif %}
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
"prepare": "node .githooks/install.js",
|
||||
"stylint": "stylint source/css/",
|
||||
"test": "mocha test/index.js",
|
||||
"test-cov": "nyc --reporter=lcovonly npm run test"
|
||||
"test-cov": "nyc npm test"
|
||||
},
|
||||
"repository": "next-theme/hexo-theme-next",
|
||||
"keywords": [
|
||||
|
||||
@ -36,10 +36,6 @@ module.exports = function(path, text, options = {}) {
|
||||
}
|
||||
}
|
||||
|
||||
if (attrs.class && Array.isArray(attrs.class)) {
|
||||
attrs.class = attrs.class.join(' ');
|
||||
}
|
||||
|
||||
// If it's external link, rewrite attributes.
|
||||
if (data.protocol && data.hostname !== siteHost) {
|
||||
attrs.external = null;
|
||||
|
||||
@ -37,4 +37,10 @@ describe('next-url', () => {
|
||||
const encoded = btoa('https://theme-next.js.org');
|
||||
nextUrl('https://theme-next.js.org', 'Text').should.eql(`<span class="exturl" data-url="${encoded}">Text</span>`);
|
||||
});
|
||||
|
||||
it('class with exturl enabled', () => {
|
||||
hexo.theme.exturl = true;
|
||||
const encoded = btoa('https://theme-next.js.org');
|
||||
nextUrl('https://theme-next.js.org', 'Text', { class: 'theme-link' }).should.eql(`<span class="exturl theme-link" data-url="${encoded}">Text</span>`);
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user