diff --git a/resources/assets/src/index.js b/resources/assets/src/index.js index d57fd48d..f53461dd 100644 --- a/resources/assets/src/index.js +++ b/resources/assets/src/index.js @@ -1,5 +1,6 @@ import Vue from 'vue'; import './js'; +import * as emitter from './js/event'; import routes from './components/route'; Vue.config.productionTip = false; @@ -20,6 +21,9 @@ if (process.env.NODE_ENV === 'development') { Vue.prototype.$route = (new RegExp(`^${route.path}$`, 'i')).exec(blessing.route); new Vue({ el: route.el, + mounted() { + emitter.emit('mounted', { el: route.el }); + }, render: h => h(route.component) }); } diff --git a/resources/assets/tests/js/net.test.js b/resources/assets/tests/js/net.test.js index 2aec95b2..cf459ce0 100644 --- a/resources/assets/tests/js/net.test.js +++ b/resources/assets/tests/js/net.test.js @@ -10,7 +10,6 @@ window.Request = function Request(url, init) { this.headers = new Map(Object.entries(init.headers)); }; - test('the GET method', async () => { const json = jest.fn().mockResolvedValue({}); window.fetch = jest.fn().mockResolvedValue({