@@ -3,7 +3,7 @@ import os from 'os';
33import path from 'path' ;
44import webpack from 'webpack' ;
55import HtmlBundlerPlugin from '../src' ;
6- import { compareFiles } from './utils/helpers' ;
6+ import { compareFiles , compareFilesRuns } from './utils/helpers' ;
77
88beforeAll ( ( ) => {
99 // important: the environment constant is used in code
@@ -25,6 +25,22 @@ describe('issue tests', () => {
2525
2626 test ( 'issue infinity walk by circular dependency' , ( ) => compareFiles ( 'issue-mui-css' ) ) ;
2727
28+ test ( 'filesystem cache restores script on second run, issue #190' , async ( ) => {
29+ const testPath = path . join ( __dirname , 'issues/issue-190-cache-filesystem-js' ) ;
30+ const cleanup = ( ) => {
31+ fs . rmSync ( path . join ( testPath , 'dist' ) , { recursive : true , force : true } ) ;
32+ fs . rmSync ( path . join ( testPath , '.cache' ) , { recursive : true , force : true } ) ;
33+ } ;
34+
35+ cleanup ( ) ;
36+
37+ try {
38+ await compareFilesRuns ( '../issues/issue-190-cache-filesystem-js' , false , 2 ) ;
39+ } finally {
40+ cleanup ( ) ;
41+ }
42+ } ) ;
43+
2844 test ( 'multi compiler invalid hook handles null filename, issue #191' , ( ) => {
2945 const context = fs . mkdtempSync ( path . join ( os . tmpdir ( ) , 'html-bundler-webpack-plugin-' ) ) ;
3046 const sourcePath = path . join ( context , 'src' ) ;
0 commit comments