<template> <section class="weather"> <h1 class="weather__title">{{ weather.title }}</h1> <ForcastCard v-for="(forecast, i) in weather.forecasts" :forecast="forecast" :key="`weather__forcasts-key-${i}`"/> </section> </template> <script> import ForcastCard from '~/components/Pages/ForcastCard'; import { mapFields } from 'vuex-map-fields'; export default { components: { ForcastCard }, computed: { ...
ã¯ãã㫠天æ°APIãä¾ã«ãèªåãçè§£ãã«ããã£ãVuexã»ãã¹ãï¼jestï¼ãã¡ã¤ã³ã«è§£èª¬ãããã¨æãã¾ãã åä½ã®è¨äºï¼Vuexã ãã¨ãï¼ã¯è¯ããã®ãããããããã®ã§ãä¸éãå®è£ ããã¨ããããªã³ã¼ãã«ãªããã¼ãã¨ãããµã³ãã«æãæèãã¾ããð ç°å¢ nuxt : 2.0.0 @vue/test-utils: 1.0.0-beta.26 vue-jest : 3.0.0 vuex-map-fields : 1.3.1 lodash : 4.17.11 axios : 0.18.0 ç®æãã¨ãã livedoorã®ã天æ°Webãµã¼ãã¹APIãWeather Hacksãã使ã£ã¦å¤©æ°ãåå¾ ï¼http://weather.livedoor.com/weather_hacks/webservice ï¼ åå¾ãããã¼ã¿ãã¹ãã¢ï¼Vuexï¼ã§ç®¡ç ã仿¥ããæ´ãã®ã¡é¨ããç»åãé¨åãã³ã³ãã¼ãã³
import { createLocalVue } from '@vue/test-utils'; import Vuex from 'vuex'; import { cloneDeep } from 'lodash'; import weatherAppStore from '../../src/store/modules/weather-app'; const localVue = createLocalVue(); localVue.use(Vuex); describe('WeatherAppã¹ãã¢ã®ãã¹ã', () => { let store; beforeEach(() => { store = new Vuex.Store(cloneDeep(weatherAppStore)); }); it('天æ°ãåå¾', () => { const payloadStub = { f
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}