@@ -129,3 +129,37 @@ it('prints a warning if the assertion is not awaited in the browser mode', async
|
129 | 129 | expect(stderr).toContain('Promise returned by \`expect(actual).resolves.toBe(expected)\` was not awaited') |
130 | 130 | expect(stderr).toContain('base.test.js:5:33') |
131 | 131 | }) |
| 132 | + |
| 133 | +it('reports test file if it failed to load', async () => { |
| 134 | +const hooks: string[] = [] |
| 135 | +await runInlineTests({ |
| 136 | +'basic.test.js': `throw new Error('fail')`, |
| 137 | +}, { |
| 138 | +reporters: [ |
| 139 | +'default', |
| 140 | +{ |
| 141 | +onTestModuleQueued(testModule) { |
| 142 | +hooks.push(`onTestModuleQueued:${testModule.relativeModuleId}`) |
| 143 | +}, |
| 144 | +onTestModuleStart(testModule) { |
| 145 | +hooks.push(`onTestModuleStart:${testModule.relativeModuleId}`) |
| 146 | +}, |
| 147 | +onTestModuleCollected(testModule) { |
| 148 | +hooks.push(`onTestModuleCollected:${testModule.relativeModuleId}`) |
| 149 | +}, |
| 150 | +onTestModuleEnd(testModule) { |
| 151 | +hooks.push(`onTestModuleEnd:${testModule.relativeModuleId}`) |
| 152 | +}, |
| 153 | +}, |
| 154 | +], |
| 155 | +}) |
| 156 | + |
| 157 | +expect(hooks).toMatchInlineSnapshot(` |
| 158 | + [ |
| 159 | + "onTestModuleQueued:basic.test.js", |
| 160 | + "onTestModuleCollected:basic.test.js", |
| 161 | + "onTestModuleStart:basic.test.js", |
| 162 | + "onTestModuleEnd:basic.test.js", |
| 163 | + ] |
| 164 | + `) |
| 165 | +}) |