11import { EventEmitter } from 'events'
2- import chai , { expect } from 'chai'
2+ import chai , { assert , expect } from 'chai'
33import fs from 'fs-extra'
44import path from 'path'
55import retry from 'bluebird-retry'
@@ -97,7 +97,7 @@ describe('compilation - e2e', () => {
9797
9898 try {
9999 await preprocessor ( ) ( file )
100- throw new Error ( 'Should not resolve' )
100+ assert . fail ( )
101101 } catch ( err ) {
102102 snapshot ( normalizeErrMessage ( err . message ) )
103103 }
@@ -108,7 +108,7 @@ describe('compilation - e2e', () => {
108108
109109 try {
110110 await preprocessor ( ) ( file )
111- throw new Error ( 'Should not resolve' )
111+ assert . fail ( )
112112 } catch ( err ) {
113113 snapshot ( normalizeErrMessage ( err . message ) )
114114 }
@@ -124,6 +124,13 @@ describe('compilation - e2e', () => {
124124 await fs . outputFile ( file . filePath , '{' )
125125
126126 await retry ( ( ) => expect ( _emit ) . calledWith ( 'rerun' ) )
127+
128+ try {
129+ await preprocessor ( ) ( file )
130+ assert . fail ( )
131+ } catch ( err ) {
132+ expect ( err . message ) . to . not . be . empty
133+ }
127134 } )
128135
129136 it ( 'does not call rerun on initial build, but on subsequent builds' , async ( ) => {
@@ -145,7 +152,7 @@ describe('compilation - e2e', () => {
145152
146153 try {
147154 await preprocessor ( ) ( file )
148- throw new Error ( 'Should not resolve' )
155+ assert . fail ( )
149156 } catch ( err ) {
150157 expect ( err . message ) . to . not . be . empty
151158 }
0 commit comments