Skip to content

Commit cacf34a

Browse files
committed
Check for inlineSoruceMaps first
1 parent a998abb commit cacf34a

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/harness/compilerRunner.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -228,14 +228,17 @@ class CompilerBaselineRunner extends RunnerBase {
228228
});
229229

230230
it('Correct Sourcemap output for ' + fileName, () => {
231-
if (options.sourceMap && result.sourceMaps.length !== result.files.length) {
232-
throw new Error('Number of sourcemap files should be same as js files.');
233-
}
234-
else if (options.inlineSourceMap && result.sourceMaps.length > 0) {
235-
throw new Error('No sourcemap files should be generated if inlineSourceMaps was set.');
231+
if (options.inlineSourceMap) {
232+
if (result.sourceMaps.length > 0) {
233+
throw new Error('No sourcemap files should be generated if inlineSourceMaps was set.');
234+
}
235+
return null;
236236
}
237+
else if (options.sourceMap) {
238+
if (result.sourceMaps.length !== result.files.length) {
239+
throw new Error('Number of sourcemap files should be same as js files.');
240+
}
237241

238-
if (options.sourceMap) {
239242
Harness.Baseline.runBaseline('Correct Sourcemap output for ' + fileName, justName.replace(/\.ts/, '.js.map'), () => {
240243
if (options.noEmitOnError && result.errors.length !== 0 && result.sourceMaps.length === 0) {
241244
// We need to return null here or the runBaseLine will actually create a empty file.

0 commit comments

Comments
 (0)