Skip to content

Commit

Permalink
test: update snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
ktsn committed May 19, 2020
1 parent 06f5ccd commit d39f645
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 54 deletions.
86 changes: 42 additions & 44 deletions test/__snapshots__/webpack-plugin.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -219,40 +219,40 @@ console.log(___WEBPACK_IMPORTED_MODULE_0__[\\"default\\"])
\\"use strict\\";
__webpack_require__.r(__webpack_exports__);
function Index() {
function index() {
return __webpack_require__.e(/* import() | index */ 1).then(__webpack_require__.t.bind(null, 2, 7))
}
function UsersFoo() {
function users_foo() {
return __webpack_require__.e(/* import() | users-foo */ 2).then(__webpack_require__.t.bind(null, 3, 7))
}
function UsersId() {
function users__id() {
return __webpack_require__.e(/* import() | users-id */ 3).then(__webpack_require__.t.bind(null, 4, 7))
}
/* harmony default export */ __webpack_exports__[\\"default\\"] = ([
{
name: 'index',
path: '/',
component: Index
component: index,
},
{
name: 'users-foo',
path: '/users/foo',
component: UsersFoo
component: users_foo,
},
{
name: 'users-id',
path: '/users/:id?',
component: UsersId
}
component: users__id,
},
]);
/***/ })
/******/ ]);"
`;

exports[`webpack plugin should not stop watching after detecting route meta syntax errors 1`] = `
exports[`webpack plugin should not stop watching after detecting route custom block syntax errors 1`] = `
"/******/ (function(modules) { // webpackBootstrap
/******/ // install a JSONP callback for chunk loading
/******/ function webpackJsonpCallback(data) {
Expand Down Expand Up @@ -471,35 +471,35 @@ console.log(___WEBPACK_IMPORTED_MODULE_0__[\\"default\\"])
\\"use strict\\";
__webpack_require__.r(__webpack_exports__);
function Index() {
function index() {
return __webpack_require__.e(/* import() | index */ 1).then(__webpack_require__.t.bind(null, 2, 7))
}
function UsersFoo() {
function users_foo() {
return __webpack_require__.e(/* import() | users-foo */ 2).then(__webpack_require__.t.bind(null, 3, 7))
}
function UsersId() {
function users__id() {
return __webpack_require__.e(/* import() | users-id */ 3).then(__webpack_require__.t.bind(null, 4, 7))
}
/* harmony default export */ __webpack_exports__[\\"default\\"] = ([
{
name: 'index',
path: '/',
component: Index
component: index,
},
{
name: 'users-foo',
path: '/users/foo',
component: UsersFoo,
component: users_foo,
meta: {
requiresAuth: true
}
requiresAuth: true,
},
},
{
name: 'users-id',
path: '/users/:id?',
component: UsersId
}
component: users__id,
},
]);
Expand Down Expand Up @@ -726,50 +726,50 @@ console.log(___WEBPACK_IMPORTED_MODULE_0__[\\"default\\"])
\\"use strict\\";
__webpack_require__.r(__webpack_exports__);
function Index() {
function index() {
return __webpack_require__.e(/* import() | index */ 1).then(__webpack_require__.t.bind(null, 2, 7))
}
function Users() {
function users() {
return __webpack_require__.e(/* import() | users */ 4).then(__webpack_require__.t.bind(null, 5, 7))
}
function UsersFoo() {
function users_foo() {
return __webpack_require__.e(/* import() | users-foo */ 2).then(__webpack_require__.t.bind(null, 3, 7))
}
function UsersId() {
function users__id() {
return __webpack_require__.e(/* import() | users-id */ 3).then(__webpack_require__.t.bind(null, 4, 7))
}
/* harmony default export */ __webpack_exports__[\\"default\\"] = ([
{
name: 'index',
path: '/',
component: Index
component: index,
},
{
name: 'users',
path: '/users',
component: Users,
component: users,
children: [
{
name: 'users-foo',
path: 'foo',
component: UsersFoo
component: users_foo,
},
{
name: 'users-id',
path: ':id?',
component: UsersId
}
]
}
component: users__id,
},
],
},
]);
/***/ })
/******/ ]);"
`;

exports[`webpack plugin watches changing route meta data 1`] = `
exports[`webpack plugin watches changing route custom block data 1`] = `
"/******/ (function(modules) { // webpackBootstrap
/******/ // install a JSONP callback for chunk loading
/******/ function webpackJsonpCallback(data) {
Expand Down Expand Up @@ -988,35 +988,33 @@ console.log(___WEBPACK_IMPORTED_MODULE_0__[\\"default\\"])
\\"use strict\\";
__webpack_require__.r(__webpack_exports__);
function Index() {
function index() {
return __webpack_require__.e(/* import() | index */ 1).then(__webpack_require__.t.bind(null, 2, 7))
}
function UsersFoo() {
function users_foo() {
return __webpack_require__.e(/* import() | users-foo */ 2).then(__webpack_require__.t.bind(null, 3, 7))
}
function UsersId() {
function users__id() {
return __webpack_require__.e(/* import() | users-id */ 3).then(__webpack_require__.t.bind(null, 4, 7))
}
/* harmony default export */ __webpack_exports__[\\"default\\"] = ([
{
name: 'index',
path: '/',
component: Index
component: index,
},
{
name: 'users-foo',
path: '/users/foo',
component: UsersFoo,
meta: {
requiresAuth: true
}
component: users_foo,
requiresAuth: true,
},
{
name: 'users-id',
path: '/users/:id?',
component: UsersId
}
component: users__id,
},
]);
Expand Down Expand Up @@ -1243,24 +1241,24 @@ console.log(___WEBPACK_IMPORTED_MODULE_0__[\\"default\\"])
\\"use strict\\";
__webpack_require__.r(__webpack_exports__);
function Index() {
function index() {
return __webpack_require__.e(/* import() | index */ 1).then(__webpack_require__.t.bind(null, 2, 7))
}
function UsersId() {
function users__id() {
return __webpack_require__.e(/* import() | users-id */ 3).then(__webpack_require__.t.bind(null, 4, 7))
}
/* harmony default export */ __webpack_exports__[\\"default\\"] = ([
{
name: 'index',
path: '/',
component: Index
component: index,
},
{
name: 'users-id',
path: '/users/:id?',
component: UsersId
}
component: users__id,
},
]);
Expand Down
24 changes: 14 additions & 10 deletions test/webpack-plugin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ describe('webpack plugin', () => {
})
})

it('watches changing route meta data', (done) => {
it('watches changing route custom block data', (done) => {
const plugin = new Plugin({
pages: resolve('fixtures/pages'),
})
Expand All @@ -91,11 +91,11 @@ describe('webpack plugin', () => {
addPage(
'users/foo.vue',
`
<route-meta>
<route>
{
"requiresAuth": true
}
</route-meta>
</route>
`
)
break
Expand Down Expand Up @@ -145,7 +145,7 @@ describe('webpack plugin', () => {
}, 5000)
}, 10000)

it('should not stop watching after detecting route meta syntax errors', (done) => {
it('should not stop watching after detecting route custom block syntax errors', (done) => {
const plugin = new Plugin({
pages: resolve('fixtures/pages'),
})
Expand All @@ -158,23 +158,27 @@ describe('webpack plugin', () => {
addPage(
'users/foo.vue',
`
<route-meta>
<route>
{
"requiresAuth": true,
"meta": {
"requiresAuth": true,
}
}
</route-meta>
</route>
`
)
break
case 2:
addPage(
'users/foo.vue',
`
<route-meta>
<route>
{
"requiresAuth": true
"meta": {
"requiresAuth": true
}
}
</route-meta>
</route>
`
)
break
Expand Down

0 comments on commit d39f645

Please sign in to comment.