@@ -375,7 +375,7 @@ describe('PreloadPlugin filters chunks', function() {
375375 } ) ;
376376} ) ;
377377
378- describe ( 'PreloadPlugin preloads all assets' , function ( ) {
378+ // describe('PreloadPlugin preloads all assets', function() {
379379// it('adds preload tags', function(done) {
380380// const compiler = webpack({
381381// entry: path.join(__dirname, 'fixtures', 'load-css.js'),
@@ -432,36 +432,36 @@ describe('PreloadPlugin preloads all assets', function() {
432432// });
433433// });
434434
435- // describe('filtering unwanted files', function() {
436- // it('does not include map files to be preloaded', function(done) {
437- // const compiler = webpack({
438- // entry: {
439- // js: path.join(__dirname, 'fixtures', 'file.js')
440- // },
441- // output: {
442- // path: OUTPUT_DIR,
443- // filename: 'bundle.js',
444- // chunkFilename: 'chunk.[chunkhash].js',
445- // publicPath: '/',
446- // },
447- // devtool: 'cheap-source-map',
448- // plugins: [
449- // new HtmlWebpackPlugin(),
450- // new PreloadPlugin()
451- // ]
452- // }, function(err, result) {
453- // expect(err).toBeFalsy();
454- // expect(JSON.stringify(result.compilation.errors)).toBe('[]');
455- // const html = result.compilation.assets['index.html'].source();
456- // expect(html).toContain('<link rel="preload" as="script" href="/chunk.');
457- // expect(html).not.toContain('.map"');
458- // done();
459- // });
460- // compiler.outputFileSystem = new MemoryFileSystem();
461- // });
462- // });
435+ describe ( 'filtering unwanted files' , function ( ) {
436+ it ( 'does not include map files to be preloaded' , function ( done ) {
437+ const compiler = webpack ( {
438+ entry : {
439+ js : path . join ( __dirname , 'fixtures' , 'file.js' )
440+ } ,
441+ output : {
442+ path : OUTPUT_DIR ,
443+ filename : 'bundle.js' ,
444+ chunkFilename : 'chunk.[chunkhash].js' ,
445+ publicPath : '/' ,
446+ } ,
447+ devtool : 'cheap-source-map' ,
448+ plugins : [
449+ new HtmlWebpackPlugin ( ) ,
450+ new PreloadPlugin ( )
451+ ]
452+ } , function ( err , result ) {
453+ expect ( err ) . toBeFalsy ( ) ;
454+ expect ( JSON . stringify ( result . compilation . errors ) ) . toBe ( '[]' ) ;
455+ const html = result . compilation . assets [ 'index.html' ] . source ( ) ;
456+ expect ( html ) . toContain ( '<link rel="preload" as="script" href="/chunk.' ) ;
457+ expect ( html ) . not . toContain ( '.map"' ) ;
458+ done ( ) ;
459+ } ) ;
460+ compiler . outputFileSystem = new MemoryFileSystem ( ) ;
461+ } ) ;
462+ } ) ;
463463
464- // describe('multiple html', function() {
464+ describe ( 'multiple html' , function ( ) {
465465// it('each one only include their own chunk', function(done) {
466466// const compiler = webpack({
467467// entry: {
0 commit comments