Skip to content

Commit

Permalink
test: fix ssr tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Oct 24, 2018
1 parent 9d2f9a0 commit 7597bb0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions test/ssr/compile-with-webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import MemoryFS from 'memory-fs'

export function compileWithWebpack (file, extraConfig, cb) {
const config = Object.assign({
mode: 'development',
entry: path.resolve(__dirname, 'fixtures', file),
module: {
rules: [
Expand Down
12 changes: 6 additions & 6 deletions test/ssr/ssr-template.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import webpack from 'webpack'
import Vue from '../../dist/vue.runtime.common.js'
import { compileWithWebpack } from './compile-with-webpack'
import { createRenderer } from '../../packages/vue-server-renderer'
Expand All @@ -14,11 +13,12 @@ function generateClientManifest (file, cb) {
path: '/',
filename: '[name].js'
},
optimization: {
runtimeChunk: {
name: 'manifest'
}
},
plugins: [
new webpack.optimize.CommonsChunkPlugin({
name: 'manifest',
minChunks: Infinity
}),
new VueSSRClientPlugin()
]
}, fs => {
Expand Down Expand Up @@ -227,8 +227,8 @@ describe('SSR: template option', () => {
`<link rel="preload" href="/0.js" as="script">` +
`<link rel="preload" href="/test.css" as="style">` +
// images and fonts are only preloaded when explicitly asked for
(options.preloadOtherAssets ? `<link rel="preload" href="/test.woff2" as="font" type="font/woff2" crossorigin>` : ``) +
(options.preloadOtherAssets ? `<link rel="preload" href="/test.png" as="image">` : ``) +
(options.preloadOtherAssets ? `<link rel="preload" href="/test.woff2" as="font" type="font/woff2" crossorigin>` : ``) +
// unused chunks should have prefetch
(options.noPrefetch ? `` : `<link rel="prefetch" href="/1.js">`) +
// css assets should be loaded
Expand Down

0 comments on commit 7597bb0

Please sign in to comment.