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
{ | |
"root": true, | |
"extends": [ | |
"plugin:vue/recommended", | |
"standard", | |
"prettier", | |
"prettier/standard" | |
] | |
} |
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
foo({ | |
num: 3, | |
}, 1); | |
foo({ num: 3 }, | |
1); | |
foo( |
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
import { shallow } from '@vue/test-utils' | |
describe('', () => { | |
test('', () => { | |
}) | |
}) |
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
// inline conditional rendering | |
const Page = () => ( | |
<Modal> | |
{ showModalHeader && ( | |
<ModalHeader /> | |
)} | |
{ showModalMessage && ( | |
<showModalMessage /> | |
)} |
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
var elements = document.querySelectorAll('link[rel=stylesheet]'); | |
for(var i=0;i<elements.length;i++){ | |
elements[i].parentNode.removeChild(elements[i]); | |
} | |
const link = document.createElement('link') | |
link.rel='stylesheet' | |
link.href="https://cdnjs.cloudflare.com/ajax/libs/milligram/1.3.0/milligram.css" | |
document.body.append(link) | |
document.body.style.maxWidth = '700px' | |
document.body.style.margin = '0 auto' |
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
import test from 'tape' | |
import { shallow } from '@vue/test-utils' | |
import MessageToggle from '../../src/components/MessageToggle' | |
test('MessageToggle.vue renders default message', t => { | |
t.plan(1) | |
const wrapper = shallow(MessageToggle) | |
t.equal(wrapper.find('p').text(), 'default message', 'has a default message') | |
}) |
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
import test from 'tape' | |
import { shallow } from '@vue/test-utils' | |
import List from '../../src/components/List' | |
test('List.vue renders a <li> for each item in props.items', t => { | |
t.plan(1) | |
const items = ['', ''] | |
const wrapper = shallow(List, { | |
propsData: { items } | |
}) |
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
import test from 'tape' | |
import { shallow } from '@vue/test-utils' | |
import List from '../../src/components/List.vue' | |
test('List.vue renders', t => { | |
t.plan(1) | |
const wrapper = shallow(List) | |
t.equal(typeof wrapper, 'object') | |
}) |
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
const hooks = require('require-extension-hooks') | |
// Setup browser environment | |
require('browser-env')() | |
// Setup vue files to be processed by `require-extension-hooks-vue` | |
hooks('vue').plugin('vue').push() | |
// Setup vue and js files to be processed by `require-extension-hooks-babel` | |
hooks(['vue', 'js']).plugin('babel').push() |
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
import { shallow } from '@vue/test-utils' | |
import { createRenderer } from 'vue-server-renderer' | |
import List from '@/components/List.vue' | |
describe('List.vue', () => { | |
it('renders li for each item in props.items', () => { | |
const items = ['', ''] | |
const wrapper = shallow(List, { | |
propsData: { items } | |
}) |
NewerOlder