Skip to content
This repository was archived by the owner on Jun 16, 2024. It is now read-only.

Commit 326db73

Browse files
committed
test: increase test coverage
1 parent 316f44d commit 326db73

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

test/e2e/compilation.spec.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { EventEmitter } from 'events'
2-
import chai, { expect } from 'chai'
2+
import chai, { assert, expect } from 'chai'
33
import fs from 'fs-extra'
44
import path from 'path'
55
import 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

Comments
 (0)