-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fix issues with indentation - If using two spaces / complex structures indentation is broken - Use pretty which solves these issues - Update dependencies - Add missing dev dependencies - Use vue-jest - Use npm version for vue-test-utils
- Loading branch information
1 parent
3107678
commit b193932
Showing
7 changed files
with
682 additions
and
305 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
const beautify = require('js-beautify').html | ||
const beautify = require('pretty') | ||
|
||
module.exports = { | ||
test (object) { | ||
return typeof object === 'string' && object[0] === '<' | ||
}, | ||
print (val) { | ||
const removedServerRenderedText = val.replace(/ data-server-rendered="true"/, '') | ||
return beautify(removedServerRenderedText, {}) | ||
return beautify(removedServerRenderedText, { indent_size: 4 }) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { shallow } from 'vue-test-utils' | ||
import ListSpaced from './components/ListSpaced.vue' | ||
import { createRenderer } from 'vue-server-renderer' | ||
|
||
describe('ListSpaced.vue', () => { | ||
it('hasn\'t changed snapshot', () => { | ||
const renderer = createRenderer() | ||
const wrapper = shallow(ListSpaced) | ||
renderer.renderToString(wrapper.vm, (err, str) => { | ||
if (err) throw new Error(err) | ||
expect(str).toMatchSnapshot() | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`ListSpaced.vue hasn't changed snapshot 1`] = ` | ||
<aside role="banner" class="test"> | ||
<a title="one" class="one"> | ||
one | ||
</a> | ||
<a title="two" class="two"> | ||
two | ||
</a> | ||
<a title="three" class="three"> | ||
three | ||
</a> | ||
<a title="four" class="four"> | ||
four | ||
</a> | ||
</aside> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<template> | ||
<aside class="test" role="banner"> | ||
<a | ||
title="one" | ||
class="one"> | ||
one | ||
</a> | ||
<a | ||
title="two" | ||
class="two"> | ||
two | ||
</a> | ||
<a | ||
title="three" | ||
class="three"> | ||
three | ||
</a> | ||
<a | ||
title="four" | ||
class="four"> | ||
four | ||
</a> | ||
</aside> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'ListSpaced' | ||
} | ||
</script> |
Oops, something went wrong.