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 { shallowMount } 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 = shallowMount(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 { shallowMount } from '@vue/test-utils' | |
import List from '@/components/List.vue' | |
describe('List.vue', () => { | |
it('renders li for each item in props.items', () => { | |
const items = ['', ''] | |
const wrapper = shallowMount(List, { | |
propsData: { items } | |
}) | |
expect(wrapper.findAll('li')).toHaveLength(items.length) |
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 { mount } from '@vue/test-utils' | |
import MessageToggle from '@/components/MessageToggle.vue' | |
describe('MessageToggle.vue', () => { | |
it('displays default message', () => { | |
const wrapper = mount(MessageToggle) | |
expect(wrapper.text()).toContain('default message') | |
}) | |
it('toggles message when button is clicked', () => { |
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 { shallowMount } from '@vue/test-utils' | |
import MessageToggle from '@/components/MessageToggle.vue' | |
describe('MessageToggle.vue', () => { | |
it('displays default message', () => { | |
const wrapper = shallowMount(MessageToggle) | |
expect(wrapper.text()).toContain('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
export default { | |
// Включает абстрактный компонент во Vue. | |
// Это свойство не задокументировано и может измениться в любой момент, | |
// но ваш компонент должен работать без него. | |
abstract: true, | |
// Входные параметры отлично работают в абстрактных компонентах! | |
props: { | |
threshold: { | |
type: Array |
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
# ---- Базовый Node ---- | |
FROM node:carbon AS base | |
# Создать директорию app | |
WORKDIR /app | |
# ---- Зависимости ---- | |
FROM base AS dependencies | |
# Используется символ подстановки для копирования как package.json, так и package-lock.json | |
COPY package*.json ./ | |
# Установить зависимости приложения, включая предназначенные для разработки ('devDependencies') |
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
FROM node:carbon | |
# Создать директорию app | |
WORKDIR /app | |
# Установить зависимости приложения | |
# RUN npm -g install serve | |
# Используется символ подстановки для копирования как package.json, так и package-lock.json | |
COPY package*.json ./ |
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
FROM node:carbon | |
# Создать директорию app | |
WORKDIR /app | |
# Установить зависимости приложения | |
RUN npm -g install serve | |
# Используется символ подстановки для копирования как package.json, так и package-lock.json | |
COPY package*.json ./ |
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
FROM node:carbon | |
# Создать директорию app | |
WORKDIR /app | |
# Установить nodemon для горячей перезагрузки | |
RUN npm install -g nodemon | |
# Установить зависимости приложения | |
# Используется символ подстановки для копирования как package.json, так и package-lock.json, |
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
FROM node:carbon | |
# Создать директорию app | |
WORKDIR /app | |
# Установить зависимости приложения | |
# Используется символ подстановки для копирования как package.json, так и package-lock.json, | |
# работает с npm@5+ | |
COPY package*.json ./ |
NewerOlder