def test_reporting_errors(self):
     #TODO:
     self.compile_bundles('webpack.config.error.js')
     try:
         get_bundle('main')
     except WebpackException as e:
         self.assertIn("Cannot resolve module 'the-library-that-did-not-exist'", str(e))
 def test_reporting_errors(self):
     # TODO:
     self.compile_bundles("webpack.config.error.js")
     try:
         get_bundle("main", get_config(DEFAULT_CONFIG))
     except WebpackError as e:
         self.assertIn("Cannot resolve module 'the-library-that-did-not-exist'", str(e))
Example #3
0
 def test_reporting_errors(self):
     #TODO:
     self.compile_bundles('webpack.config.error.js')
     try:
         get_bundle('main')
     except WebpackException as e:
         self.assertIn(
             "Cannot resolve module 'the-library-that-did-not-exist'",
             str(e))
 def test_bad_status_in_production(self):
     stats_file = open(
         settings.WEBPACK_LOADER[DEFAULT_CONFIG]['STATS_FILE'], 'w')
     stats_file.write(json.dumps({'status': 'unexpected-status'}))
     stats_file.close()
     try:
         get_bundle('main', get_config(DEFAULT_CONFIG))
     except WebpackLoaderBadStatsError as e:
         self.assertIn(
             ("The stats file does not contain valid data. Make sure "
              "webpack-bundle-tracker plugin is enabled and try to run"
              " webpack again."), str(e))
 def test_bad_status_in_production(self):
     stats_file = open(
         settings.WEBPACK_LOADER[DEFAULT_CONFIG]['STATS_FILE'], 'w'
     )
     stats_file.write(json.dumps({'status': 'unexpected-status'}))
     stats_file.close()
     try:
         get_bundle('main', get_config(DEFAULT_CONFIG))
     except WebpackLoaderBadStatsError as e:
         self.assertIn((
             "The stats file does not contain valid data. Make sure "
             "webpack-bundle-tracker plugin is enabled and try to run"
             " webpack again."
         ), str(e))